Selenium Question

Explain the difference between driver.close() and driver.quit() command in Selenium?

#Capgemini#SeniorSoftwareEngineer
3 views
Answers (1)

Submit your answer

CodingNinjas
CodingNinjas
Answered Mar 09, 2022

Answer :
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 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.

Report

Report Interview Advice

What’s wrong with this interview advice?