FAQ: Why has my Firefox Selenium WebDriver Browser Not Closed

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:

  •  .close
  • .quit

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 where to buy inderal online 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.

 

This entry was posted in FAQ, Firefox, Java, Selenium Simplified Blog, WebDriver. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *