Selenium WebDriver is a version of Selenium RC that has been upgraded. It was released into the market to address the limitations of Selenium RC. Its architecture is fundamentally different from that of RC, even though it is an improved RC version. Selenium WebDriver, like Selenium RC, supports many programming platforms to enable greater flexibility and does not require knowledge of any programming language. The advantages of Selenium WebDriver are as follows:
When compared to other tools, Selenium WebDriver completes test script execution faster.
It is one of the most widely used Open-Source tools for testing web-based applications and is simple to use. You can also run cross-browser compatibility tests using it.
API (Application Programming Interface) is more concise than Selenium RC's.
Multiple operating systems are supported, including Windows, Mac OS X, Linux, Unix, etc.
Modern browsers such as Chrome, Firefox, Opera, Safari, and Internet Explorer are supported.
It may also be used with iPhoneDriver, HtmlUnitDriver, and AndroidDriver.
Prepare for the Selenium WebDriver exam with our free practice test modules. Each quiz covers key topics to help you pass on your first try.
Selenium can be used to close the pop-up window. The pop-up window is handled by the getWindowHandles and getWindowHandle methods. The getWindowHandle method stores the window handle of the pop up in focus. The iterator method is used to cycle across the window handles. The Selenium driver has control over the parent window by default. The java code that closes popups can be found here. Three approaches should be mentioned.
WebDriver.getWindowHandles() : To get all browser handlers, use this method.
WebDriver.switchTo().window(String windowHandler) : Before closing a web page, this procedure is used to switch to it.