Environment: Win 7, Selenium 3.0.0 beta, FireFox- 49.0.1
System.setProperty("webdriver.gecko.driver","C:\\geckodriver.exe");
WebDriver driver=new FirefoxDriver();
Issue 1:
Command: driver.close();
or ((FirefoxDriver) driver).kill();
Expected Result: Browser should close.
Actual Result: Browser is not closing.
Issue 2:
Command: driver.quit();
Expected Result: Browser should close.
Actual Result: Firefox crashed.
Getting Error: "Plugin container for FireFox has stopped working."
Any suggestions...
Workaround until we have concrete fix for this. Although several posts suggest this has been fixed in version 50 and above, the fact is this is not working consistently. I have installed latest version 54 on two machines of Windows 7 and driver. Quit is working fine on one and not on other with same Java and Selenium versions. As an alternative, for executing on Windows machines, the following code would help to kill all related processes of Firefox.
if (browser == "FIREFOX")) {
try {
Runtime.getRuntime().exec("taskkill /F /IM geckodriver.exe");
Runtime.getRuntime().exec("taskkill /F /IM plugin-container.exe");
Runtime.getRuntime().exec("taskkill /F /IM firefox.exe");
} catch (IOException e) {
e.printStackTrace();
}
} else {
driver.quit();
}
driver.quit()
did work for me
driver.close()
did not.
Physically clicking on the close button using the mouse doesn't work.
Using Python 3.6, Selenium 3.4.3 together with geckodriver v.0.18.0
on Ubuntu 16.04.
Below solution is tested on Windows7 with Firefox49, Selenium 3.0.1, Python 3.5 and geckodriver-v0.11.1 and is working fine.
import os
Then call
os.system('tskill plugin-container')
before calling driver.quit()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With