Google+

386. Difference between close( ) and quit( ) Selenium WebDriver commands






close( ) WebDriver command closes the Browser window which is in focus.

If there are more than one Browser window opened by the Selenium Automation, then the close( ) command will only close the Browser window which is having focus at that time. It wont close the remaining Browser windows.

Where as quit( ) WebDriver command is generally used to shut down the WebDrivers instance. Hence it closes all the Browser windows that are opened by the Selenium Automation.

close( ) and quit( ) work in the similar way when Selenium Automation opens only single Browser window. They differ in their functionality when there are more than one Browser windows opened by the Selenium Automation.

Lets implement this in a practical way in the next posts.




Please comment below to feedback or ask questions.

Launching more than one Test Browser windows   will be explained in the next post.





No comments: