1

Firefox : 50.0.1, GeckoDriver :13, selenium 3.01, IDE: Eclipse, Programming language : Java

Using below code :

System.setProperty("webdriver.gecko.driver","C:\\geckodriver.exe); 
WebDriver driver = new FirefoxDriver();
driver.get("https://www.youtube.com/");
driver.close(); Or driver.quit()

In driver.close() the browser is not closed In driver.quite() the browser is closed and Firefox crashed. Getting Error: "plugin container for FireFox has stopped working."

Please let me know any solution

Chris Maes
  • 35,025
  • 12
  • 111
  • 136
Shilpa
  • 75
  • 2
  • 5
  • 12

4 Answers4

0

Steps you can try:

  1. Uninstall any plugins in the Firefox browser.
  2. Use the 64-bit version of geckodriver for 64-bit Firefox, similarly, 32-bit geckodriver for 32-bit Firefox.

I have tried the code in the same environment, and driver.quit worked for me. driver.close still not closing the browser.

Naveen Kumar R B
  • 6,248
  • 5
  • 32
  • 65
0

You should always use driver.quit() when you want to close browser and not just one tab.

This exception you get is unfortunately known issue when quitting geckodriver firefox instance, see this links for details.

https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/7506 https://bugzilla.mozilla.org/show_bug.cgi?id=1027222

acikojevic
  • 915
  • 1
  • 7
  • 16
0

You can create a new firefox profile steps can be found here!

In your code use this new profile created.

WebDriver webdriver;
ProfilesIni profile = new ProfilesIni();
FirefoxProfile myprofile = profile.getProfile("myProfileName");
webdriver = new FirefoxDriver(myprofile);

Now webdriver.quit(); will close the firefox browser after the test has run.

Anand
  • 183
  • 2
  • 7
0

This seems to be a problem with the geckodriver.

The workaround which worked for me was to install the older version of geckodriver, 0.20.1, which you can download here: https://github.com/mozilla/geckodriver/releases/tag/v0.20.1

RubenD
  • 21
  • 3