Skip to main content

Working With Windows in Selenium Web Drivers

IN Web Application, it may be possible that once you open the browser then multiple windows open. These windows may have advertisement or other useful information. it may be also possible that once user will click on any link then a new window or new tab will open. So in this article we will handle these multiple windows using Selenium Web Driver.

Here user will need method to handle main window by using getWindowHandle() then we need to handles all other new windows opening by getWindowHandles() method.

getWindowHandle() Return an opaque handle to this window that uniquely identifies it within this driver instance while getWindowHandles() Return a set of window handles which can be used to iterate over all open windows of this WebDriver instance by passing them to switchTo().WebDriver.Options.window()






Comments

Popular posts from this blog

What is API?

In general way, API (Application Programming Interface) is the intermediate software which is useful for two applications to communicate. API is the tool which is used for interaction of two applications. If developer developing any software which have multiple blocks (Modules) than developer use APIs to put them together.

Structural Testing

Structural Testing is the type of testing in which user should have the knowledge of the code because in this testing user need to check the structure of the system. Structural Testing is White Box Testing.