Driver.Close . It closes the instance of the current browser.
Driver. Quit.
In Selenium, both close() and quit() methods are used to close the browser. However, there is a difference between them. The close() method closes only the current browser window and quits the driver only if no other windows are left. On the other hand, the quit() method quits the driver and closes all browser windows associated with that session123.
To sum things up, use close() method for closing pop-up windows or temporary tabs, and use quit() method for ending the session when the test case is completed and you no longer need the driver instance1.
Driver.Close . It closes the instance of the current browser. Driver. Quit.
In Selenium, both close() and quit() methods are used to close the browser. However, there is a difference between them. The close() method closes only the current browser window and quits the driver only if no other windows are left. On the other hand, the quit() method quits the driver and closes all browser windows associated with that session123.
To sum things up, use close() method for closing pop-up windows or temporary tabs, and use quit() method for ending the session when the test case is completed and you no longer need the driver instance1.