Next-Gen App & Browser
Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles
In Selenium, driver.close() and driver.quit() both close the browser windows or quit the driver instance, but there is a slight difference between the two commands.
`driver.close()`: The driver.close() method is used to close the current browser window that the driver instance controls. If there is only one browser window, this command will also quit the driver instance. Otherwise, it will close only the current window and continue to run.
`driver.quit()`: The driver.quit() method closes all the browser windows opened by the driver instance and ends the WebDriver session. This command should be used when you are done with the WebDriver instance and want to clean up the resources it uses.
KaneAI - Testing Assistant
World’s first AI-Native E2E testing agent.