WebAutomation on New window RRS feed

  • Question




    1) Have web application, and a link opens a new window (automated through mshtml and casting controls and clicking the button)


    2) Require handle for the opened new window, so that further automation could be done on this new window.


    Please share code snippet if any one has...


    Thanks & Regards

    Friday, October 5, 2007 7:20 AM

All replies

  • I do not have the code to share.. but I will try to give you some pointers here based on the assumption that you are using WebApplicationAdapter. If you are, then try running it as a hosted control in which have a 'Microsoft Web Browser' control. Load your web application inside this control. Also, register for 'NewWindow2' event. You can do automation by registering for 'Document Complete' events on this browser control. You will need to make some changes switching from Windows.Forms.WebBrowser to this unmanaged web browser, but they are minor.

    To enable pop-ups and to handle their automation, have a form that has another WebBrowser control. In the event handler for 'NewWindow2' events that you have registered on first browser, instantiate the new form and use the browser control to load the popup which will take care of loading popups within this new form. In this form, you can again registed for 'DocumentComplete' event to handle automation.


    Hope that gives you the idea..

    Friday, October 26, 2007 7:08 PM