How To Handle Multiple Windows in Selenium Webdriver?

Dapheny Murphy | September 19, 2022

How To Handle Multiple Windows in Selenium Webdriver?

Selenium is an efficient tool and it is most widely used by major software QA companies.

There are some inbuilt methods available to handle multiple windows opened.

Below are the methods that work best to handle this scenario:

  1. getWindowHandles(): This method is used to get the handle of all the opened windows. This method returns a set of strings.
  2. getWindowHandle(): This method gets the window handle of a currently opened window.
  3. switchTo(): This method is used to switch the controller to the desired window.
  4. action(): This method is used to perform the desired action.

Disclaimer

This publication is for informational purposes only, and nothing contained in it should be considered legal advice. We expressly disclaim any warranty or responsibility for damages arising out of this information and encourage you to consult with legal counsel regarding your specific needs. We do not undertake any duty to update previously posted materials.

Post a Comment