In order to switch between all available windows, Selenium first needs to get hold of the window handles. For this purpose, there are two methods provided: getWindowHandle() and getWindowHandles():
- getWindowHandle(): This method, when invoked on the WebDriver object, returns the handle of the current window which has the focus
- getWindowHandles(): This method, when invoked on the WebDriver object, returns a set of all open windows