How to handle Selenium Pop-up window using Webdriver

In automation, when we have multiple windows in any web application, the activity may need to switch control among several windows from one to other in order to complete the operation. After completion of the operation, it has to return to the main window i.e. parent window. We will see this further in the article with an example.
In selenium web driver there are methods through which we can handle multiple windows.
Driver.getWindowHandles();
To handle all opened windows by web driver, we can use "Driver.getWindowHandles()" and then we can switch window from one window to another in a web application. Its return type is Iterator<String>.
Driver.getWindowHandle();
When the site opens, we need to handle the main window by driver.getWindowHandle(). This will handle the current window that uniquely identifies it within this driver instance. Its return type is String.

Comments

Popular posts from this blog

Handling Dynamic Web Tables Using Selenium WebDriver

Verify Specific Position of an Element

Read it out for TESTNG before going for an iterview