Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.7k points)

driver.quit() causes 'Firefox to stop working'

  1. The tests do not fail, but every time driver.quit is called browser crashes as in the image below.
  2. My code:

public void quitDriver() throws Exception {

    if (null != webdriver) {

        getDriver().manage().deleteAllCookies();

        webdriver.quit();

        webdriver = null;

    }

}

Factory Class:

case "firefox":

    if (null == webdriver) {

        System.setProperty("webdriver.gecko.driver", Constant.GECKO_DRIVER_DIRECTORY);

        webdriver = new FirefoxDriver();

    }

enter image description here

enter image description here

  <dependency>

        <groupId>org.seleniumhq.selenium</groupId>

        <artifactId>selenium-java</artifactId>

        <version>3.0.1</version>

    </dependency>

1 Answer

0 votes
by (62.9k points)

I suggest referring this mozilla/geckodriver releases page.

v0.14.0

Changed

Firefox process is now terminated and the session ended when the last window is closed

WebDriver library updated to version 0.20.0

Did you close the last window before calling quit?

Also, geckodriver is still dicey. Try moving to:

  • Webdriver v3.3.1

  • geckodriver v0.15.0

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...