Interview Questions

Selenium WebDriver - What is the difference between driver.close() and driver.quit command?

Selenium WebDriver Interview question and Answers


(Continued from previous question...)

Selenium WebDriver - What is the difference between driver.close() and driver.quit command?

close(): WebDriver’s close() method closes the web browser window that the user is currently working on or we can also say the window that is being currently accessed by the WebDriver. The command neither requires any parameter nor does is return any value.
quit(): Unlike close() method, quit() method closes down all the windows that the program has opened. Same as close() method, the command neither requires any parameter nor does is return any value.

(Continued on next question...)

Other Interview Questions