Question - What are driver.close() and driver.quit() in WebDriver?
Answer -
These are two different methods used to close the browser session in Selenium WebDriver:
- driver.close() - This is used to close the current browser window on which the focus is set. In this case, there is only one browser open.
- driver.quit() - It closes all the browser windows and ends the WebDriver session using the driver.dispose method.