A few FAQs come up on the Start Selenium Simplified course. When they do, it usually means that I haven’t done a good enough job of making the answer visible the first time I address it.
One that crops up a lot is “Why is my browser not closing?”
Because WebDriver has two methods:
The documentation for .close says that it will close the browser if it is the last window that is closed.
For the last few Firefox releases, this does not happen.
Therefore we use .close, and .quit.
Use .quit when you know it is the last window you are working with. Or if you are working with a Driver Manager abstraction then you might want to stick the .quit in a JVM Shutdown.
I don’t know the reasons why, I haven’t spent the time investigating. But the workaround is to use .quit to finish with the driver.