While automating any website or a web application, we must have witnessed a scenario where multiple windows open within an application when a button is clicked and the user has to perform some action on all the opened windows. Now user might not be able to work on all windows at the same time and hence need some mechanism through which he can take control over parent and child windows or if I may say from a QA’s perspective, how can we handle window using Selenium?. In this tutorial, we will be understanding how this can be achieved with Selenium WebDriver**_. _**We will be focusing on the following key topics:

  • _What is a window in Selenium? _
  • How do we identify parent window and child windows?
  • Why do we need to handle multiple windows in Selenium?
  • What is a window handle in Selenium?
  • What are the different methods used for window handling in Selenium?
  • How do we handle child windows in Selenium?
  • How to handle multiple windows in Selenium?
  • Also, how do we switch back to the parent window from the child windows in Selenium?
  • _How to close all windows in Selenium? _

#selenium-webdriver

What is Window Handle in Selenium and How to handle multiple windows?
1.40 GEEK