-1

I'm currently automating an application using selenium ,and when a button is clicked a new pop up window appears.I have to switch to that window..its like a form in which I have to fill the persons name, city etc

I am new to selenium..so any help would be appreciated.

  • 1
    Possible duplicate of [How to handle Pop up in Selenium WebDriver using Java](http://stackoverflow.com/questions/19403949/how-to-handle-pop-up-in-selenium-webdriver-using-java) – timbre timbre May 15 '16 at 14:56
  • Apart from what Kiril suggested. You can Robot Class in JAVA to handle windows handlers. – Kishan Patel May 15 '16 at 15:06
  • You should specify programming language you use, `HTML` sample for target pop-uo and code you tried so far – Andersson May 15 '16 at 16:24

3 Answers3

0

After click, popup window appears..... now 1. use Firebug to inspect fields(username) are available in Form if you are able to inspect, then no need to move control to window etc task

Just find the object path and do Actions on each fields in form. Basically it is Hidden division popup window.

0

If a new pop-up window is shown and you want to perform actions in the new window, you have to first switch to the frame/window.

Use driver.switchTo().frame(1)

or Use driver.switchTo().frame("dropboxIframe") [Example switching to dropbox window]

You will have to know the name of the frame, which you can find using inspect element.

Also after switching to different window, always provide some Thread.sleep for few seconds for that page to load.

Once you are done with work on pop-up window and want to come back to default frame, use this: driver.switchTo().defaultContent()

0

As @Bravana AS said, you need to switch to a frame:

If you have only a new frame, this one will be '1', your previous page is '0', so, use:

driver.switchTo().frame("1");

you can pass INDEX and ID to frame()

to back to your previous page:

driver.switchTo().defaultContent();

OR

driver.switchTo().frame("0");
carloseduleal
  • 49
  • 1
  • 7