Google News
logo
Selenium - Interview Questions
Explain the difference between driver.close() and driver.quit() command in Selenium?
Following is the major difference between both the commands :
 
driver.close() command closes the currently active window on which the user is working or the window being currently accessed by the web driver.

driver.quit() command, unlike the driver.close() command it closes all the windows opened by the program and hence should be used with care.

Both the commands don’t take any parameter and don’t return any value either.
Advertisement