Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to close browser : Not Fixed : Firefox 52.0 #517

Closed
snpanigrahi9 opened this issue Mar 8, 2017 · 24 comments
Closed

Unable to close browser : Not Fixed : Firefox 52.0 #517

snpanigrahi9 opened this issue Mar 8, 2017 · 24 comments

Comments

@snpanigrahi9
Copy link

In order to help us efficiently investigate your issue, please provide the following information:

Firefox 52.0

windows7 64bit

Gecko driver 0.14

Steps to reproduce -

Previously I had raised this issue. But was closed without any solution.
Hoping for a solution this time.

https://bugzilla.mozilla.org/show_bug.cgi?id=1311350
This issue has been closed from bugzilla saying that it is fixed in firefox 52 version.
But still the window is not closing.

Use the following code

package demo1;

import org.openqa.selenium.firefox.FirefoxDriver;

public class Executer2 {

public static void main(String[] args){
	
	
	System.out.println(System.getProperty("user.dir") + "/geckodriver.exe");
	System.setProperty("webdriver.gecko.driver", System.getProperty("user.dir") + "/geckodriver.exe");
	
	FirefoxDriver wd = new FirefoxDriver();
	
		wd.get("http://www.google.com");
		wd.close();	
}

}

Console OutPut

C:\Workspace\Demo/geckodriver.exe
1488964755264 geckodriver INFO Listening on 127.0.0.1:44682
1488964755520 mozprofile::profile INFO Using profile path C:\Users\A0705286\AppData\Local\Temp\1\rust_mozprofile.e9UpCdPFH14o
1488964755546 geckodriver::marionette INFO Starting browser C:\Program Files (x86)\Mozilla Firefox\firefox.exe
1488964755558 geckodriver::marionette INFO Connecting to Marionette on localhost:54923
1488964763485 addons.manager DEBUG Application has been upgraded
1488964763528 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/XPIProvider.jsm: ["XPIProvider"]
1488964763530 addons.manager DEBUG Loaded provider scope for resource://gre/modules/LightweightThemeManager.jsm: ["LightweightThemeManager"]
1488964763534 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/GMPProvider.jsm
1488964763536 addons.manager DEBUG Loaded provider scope for resource://gre/modules/addons/PluginProvider.jsm
1488964763537 addons.manager DEBUG Starting provider: XPIProvider
1488964763537 addons.xpi DEBUG startup
1488964763538 addons.xpi INFO SystemAddonInstallLocation directory is missing
1488964763540 addons.xpi INFO Mapping aushelper@mozilla.org to C:\Program Files (x86)\Mozilla Firefox\browser\features\aushelper@mozilla.org.xpi
1488964763540 addons.xpi INFO Mapping e10srollout@mozilla.org to C:\Program Files (x86)\Mozilla Firefox\browser\features\e10srollout@mozilla.org.xpi
1488964763541 addons.xpi INFO Mapping firefox@getpocket.com to C:\Program Files (x86)\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi
1488964763541 addons.xpi INFO Mapping webcompat@mozilla.org to C:\Program Files (x86)\Mozilla Firefox\browser\features\webcompat@mozilla.org.xpi
1488964763542 addons.xpi INFO Mapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to C:\Program Files (x86)\Mozilla Firefox\browser\extensions{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi
1488964763543 addons.xpi DEBUG checkForChanges
1488964763543 addons.xpi INFO SystemAddonInstallLocation directory is missing
1488964763544 addons.xpi DEBUG Loaded add-on state from prefs: {}
1488964763545 addons.xpi DEBUG New add-on aushelper@mozilla.org in app-system-defaults
1488964763546 addons.xpi DEBUG getModTime: Recursive scan of aushelper@mozilla.org
1488964763546 addons.xpi DEBUG New add-on e10srollout@mozilla.org in app-system-defaults
1488964763547 addons.xpi DEBUG getModTime: Recursive scan of e10srollout@mozilla.org
1488964763547 addons.xpi DEBUG New add-on firefox@getpocket.com in app-system-defaults
1488964763548 addons.xpi DEBUG getModTime: Recursive scan of firefox@getpocket.com
1488964763548 addons.xpi DEBUG New add-on webcompat@mozilla.org in app-system-defaults
1488964763548 addons.xpi DEBUG getModTime: Recursive scan of webcompat@mozilla.org
1488964763549 addons.xpi DEBUG New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} in app-global
1488964763550 addons.xpi DEBUG getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1488964763550 addons.xpi DEBUG getInstallState changed: true, state: {"app-system-defaults":{"aushelper@mozilla.org":{"d":"C:\Program Files (x86)\Mozilla Firefox\browser\features\aushelper@mozilla.org.xpi","st":1488490724000},"e10srollout@mozilla.org":{"d":"C:\Program Files (x86)\Mozilla Firefox\browser\features\e10srollout@mozilla.org.xpi","st":1488490724000},"firefox@getpocket.com":{"d":"C:\Program Files (x86)\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi","st":1488490725000},"webcompat@mozilla.org":{"d":"C:\Program Files (x86)\Mozilla Firefox\browser\features\webcompat@mozilla.org.xpi","st":1488490724000}},"app-global":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"d":"C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","st":1488490724000}}}
1488964763561 addons.xpi-utils DEBUG Opening XPI database C:\Users\A0705286\AppData\Local\Temp\1\rust_mozprofile.e9UpCdPFH14o\extensions.json
1488964763562 addons.xpi-utils DEBUG Attempting to upgrade from SQLITE database
1488964763564 addons.xpi-utils DEBUG Migrating data from sqlite
1488964763565 addons.xpi-utils ERROR Unable to read anything useful from the database
1488964763567 addons.xpi-utils DEBUG New add-on aushelper@mozilla.org installed in app-system-defaults
*** Blocklist::_loadBlocklistFromFile: blocklist is disabled
1488964763580 DeferredSave.extensions.json DEBUG Save changes
1488964763580 addons.xpi-utils DEBUG New add-on e10srollout@mozilla.org installed in app-system-defaults
1488964763585 DeferredSave.extensions.json DEBUG Starting timer
1488964763586 DeferredSave.extensions.json DEBUG Save changes
1488964763587 addons.xpi-utils DEBUG New add-on firefox@getpocket.com installed in app-system-defaults
1488964763595 DeferredSave.extensions.json DEBUG Save changes
1488964763595 addons.xpi-utils DEBUG New add-on webcompat@mozilla.org installed in app-system-defaults
1488964763601 DeferredSave.extensions.json DEBUG Save changes
1488964763602 addons.xpi-utils DEBUG New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
1488964763606 DeferredSave.extensions.json DEBUG Save changes
1488964763607 addons.manager DEBUG Registering startup change 'installed' for aushelper@mozilla.org
1488964763614 addons.xpi DEBUG Loading bootstrap scope from C:\Program Files (x86)\Mozilla Firefox\browser\features\aushelper@mozilla.org.xpi
1488964763620 addons.xpi DEBUG Calling bootstrap method install on aushelper@mozilla.org version 2.0
1488964763620 addons.xpi-utils DEBUG Make addon app-system-defaults:aushelper@mozilla.org visible
1488964763621 DeferredSave.extensions.json DEBUG Save changes
1488964763622 addons.manager DEBUG Registering startup change 'installed' for e10srollout@mozilla.org
1488964763622 addons.xpi DEBUG Loading bootstrap scope from C:\Program Files (x86)\Mozilla Firefox\browser\features\e10srollout@mozilla.org.xpi
1488964763626 addons.xpi DEBUG Calling bootstrap method install on e10srollout@mozilla.org version 1.9
1488964763628 addons.xpi-utils DEBUG Make addon app-system-defaults:e10srollout@mozilla.org visible
1488964763628 DeferredSave.extensions.json DEBUG Save changes
1488964763629 addons.manager DEBUG Registering startup change 'installed' for firefox@getpocket.com
1488964763629 addons.xpi DEBUG Loading bootstrap scope from C:\Program Files (x86)\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi
1488964763636 addons.xpi DEBUG Calling bootstrap method install on firefox@getpocket.com version 1.0.5
1488964763636 addons.xpi-utils DEBUG Make addon app-system-defaults:firefox@getpocket.com visible
1488964763637 DeferredSave.extensions.json DEBUG Save changes
1488964763637 addons.manager DEBUG Registering startup change 'installed' for webcompat@mozilla.org
1488964763637 addons.xpi DEBUG Loading bootstrap scope from C:\Program Files (x86)\Mozilla Firefox\browser\features\webcompat@mozilla.org.xpi
1488964763641 addons.xpi DEBUG Calling bootstrap method install on webcompat@mozilla.org version 1.0
1488964763641 addons.xpi-utils DEBUG Make addon app-system-defaults:webcompat@mozilla.org visible
1488964763642 DeferredSave.extensions.json DEBUG Save changes
1488964763642 addons.xpi-utils DEBUG Make addon app-global:{972ce4c6-7e08-4474-a285-3208198ce6fd} visible
1488964763642 DeferredSave.extensions.json DEBUG Save changes
1488964763643 addons.xpi DEBUG Updating XPIState for {"id":"aushelper@mozilla.org","syncGUID":"{45c00a03-a71d-4c60-80e3-d8b26ebf3975}","location":"app-system-defaults","version":"2.0","type":"extension","internalName":null,"updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Application Update Service Helper","description":"Sets value(s) in the update url based on custom checks.","creator":null,"homepageURL":null},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\Program Files (x86)\Mozilla Firefox\browser\features\aushelper@mozilla.org.xpi","installDate":1488490724000,"updateDate":1488490724000,"applyBackgroundUpdates":1,"bootstrap":true,"skinnable":false,"size":8486,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":false,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"52.0","maxVersion":"52."}],"targetPlatforms":[],"multiprocessCompatible":true,"seen":true,"dependencies":[],"hasEmbeddedWebExtension":false,"mpcOptedOut":false}
1488964763643 addons.xpi DEBUG getModTime: Recursive scan of aushelper@mozilla.org
1488964763643 addons.xpi DEBUG Updating XPIState for {"id":"e10srollout@mozilla.org","syncGUID":"{c2c9ec65-4ea1-481f-a74b-c8c8936ae867}","location":"app-system-defaults","version":"1.9","type":"extension","internalName":null,"updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Multi-process staged rollout","description":"Staged rollout of Firefox multi-process feature.","creator":null,"homepageURL":null},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\Program Files (x86)\Mozilla Firefox\browser\features\e10srollout@mozilla.org.xpi","installDate":1488490724000,"updateDate":1488490724000,"applyBackgroundUpdates":1,"bootstrap":true,"skinnable":false,"size":7181,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":false,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"52.0","maxVersion":"52.
"}],"targetPlatforms":[],"multiprocessCompatible":true,"seen":true,"dependencies":[],"hasEmbeddedWebExtension":false,"mpcOptedOut":false}
1488964763643 addons.xpi DEBUG getModTime: Recursive scan of e10srollout@mozilla.org
1488964763644 addons.xpi DEBUG Updating XPIState for {"id":"firefox@getpocket.com","syncGUID":"{e1b0c763-1ec5-484e-a2da-d764692ce29a}","location":"app-system-defaults","version":"1.0.5","type":"extension","internalName":null,"updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Pocket","description":"When you find something you want to view later, put it in Pocket.","creator":null,"homepageURL":null},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\Program Files (x86)\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi","installDate":1488490725000,"updateDate":1488490725000,"applyBackgroundUpdates":1,"bootstrap":true,"skinnable":false,"size":920279,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":false,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"52.0","maxVersion":"52."}],"targetPlatforms":[],"multiprocessCompatible":true,"seen":true,"dependencies":[],"hasEmbeddedWebExtension":false,"mpcOptedOut":false}
1488964763645 addons.xpi DEBUG getModTime: Recursive scan of firefox@getpocket.com
1488964763646 addons.xpi DEBUG Updating XPIState for {"id":"webcompat@mozilla.org","syncGUID":"{35edc176-e728-4b87-b487-7ddace5cba3f}","location":"app-system-defaults","version":"1.0","type":"extension","internalName":null,"updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Web Compat","description":"Urgent post-release fixes for web compatibility.","creator":null,"homepageURL":null},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\Program Files (x86)\Mozilla Firefox\browser\features\webcompat@mozilla.org.xpi","installDate":1488490724000,"updateDate":1488490724000,"applyBackgroundUpdates":1,"bootstrap":true,"skinnable":false,"size":1454,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":false,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"52.0","maxVersion":"52.
"}],"targetPlatforms":[],"multiprocessCompatible":true,"seen":true,"dependencies":[],"hasEmbeddedWebExtension":false,"mpcOptedOut":false}
1488964763646 addons.xpi DEBUG getModTime: Recursive scan of webcompat@mozilla.org
1488964763647 addons.xpi DEBUG Updating XPIState for {"id":"{972ce4c6-7e08-4474-a285-3208198ce6fd}","syncGUID":"{201cf7b9-c285-4a6e-a703-afdfddc84652}","location":"app-global","version":"52.0","type":"theme","internalName":"classic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\Program Files (x86)\Mozilla Firefox\browser\extensions\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","installDate":1488490724000,"updateDate":1488490724000,"applyBackgroundUpdates":1,"skinnable":true,"size":19581,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"52.0","maxVersion":"52.0"}],"targetPlatforms":[],"seen":true,"dependencies":[],"hasEmbeddedWebExtension":false}
1488964763648 addons.xpi DEBUG getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1488964763650 DeferredSave.extensions.json DEBUG Save changes
1488964763652 addons.xpi DEBUG Updating database with changes to installed add-ons
1488964763652 addons.xpi-utils DEBUG Updating add-on states
1488964763662 addons.xpi-utils DEBUG Writing add-ons list
1488964763676 addons.xpi DEBUG Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\aushelper@mozilla.org.xpi
1488964763677 addons.xpi DEBUG Calling bootstrap method startup on aushelper@mozilla.org version 2.0
1488964763680 addons.xpi DEBUG Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\e10srollout@mozilla.org.xpi
1488964763681 addons.xpi DEBUG Calling bootstrap method startup on e10srollout@mozilla.org version 1.9
1488964763682 addons.xpi DEBUG Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi
1488964763683 addons.xpi DEBUG Calling bootstrap method startup on firefox@getpocket.com version 1.0.5
1488964763685 addons.xpi DEBUG Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\webcompat@mozilla.org.xpi
1488964763686 addons.xpi DEBUG Calling bootstrap method startup on webcompat@mozilla.org version 1.0
1488964763688 addons.manager DEBUG Registering shutdown blocker for XPIProvider
1488964763688 addons.manager DEBUG Provider finished startup: XPIProvider
1488964763688 addons.manager DEBUG Starting provider: LightweightThemeManager
1488964763688 addons.manager DEBUG Registering shutdown blocker for LightweightThemeManager
1488964763689 addons.manager DEBUG Provider finished startup: LightweightThemeManager
1488964763689 addons.manager DEBUG Starting provider: GMPProvider
1488964763701 addons.manager DEBUG Registering shutdown blocker for GMPProvider
1488964763701 addons.manager DEBUG Provider finished startup: GMPProvider
1488964763701 addons.manager DEBUG Starting provider: PluginProvider
1488964763702 addons.manager DEBUG Registering shutdown blocker for PluginProvider
1488964763702 addons.manager DEBUG Provider finished startup: PluginProvider
1488964763702 addons.manager DEBUG Completed startup sequence
1488964764089 Marionette INFO Listening on port 54923
JavaScript error: resource://app/components/nsBrowserGlue.js, line 1900: NS_ERROR_ABORT: Component returned failure code: 0x80004004 (NS_ERROR_ABORT) [nsIPrefBranch.getComplexValue]
1488964764239 addons.manager DEBUG Starting provider:
1488964764239 addons.manager DEBUG Registering shutdown blocker for
1488964764240 addons.manager DEBUG Provider finished startup:
1488964764305 addons.manager DEBUG Starting provider: PreviousExperimentProvider
1488964764306 addons.manager DEBUG Registering shutdown blocker for PreviousExperimentProvider
1488964764306 addons.manager DEBUG Provider finished startup: PreviousExperimentProvider
1488964764310 DeferredSave.extensions.json DEBUG Starting write
1488964764513 DeferredSave.extensions.json DEBUG Write succeeded
1488964764514 addons.xpi-utils DEBUG XPI Database saved, setting schema version preference to 19
Mar 08, 2017 2:49:26 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:"C:\Program Files (x86)\HP\Unified Functional Testing\bin\java_shared\classes";"C:\Program Files (x86)\HP\Unified Functional Testing\bin\java_shared\classes\jasmine.jar"

@JoeStoner
Copy link

JoeStoner commented Mar 8, 2017

I have a similar problem:

Selenium 3.2.0 crashes FireFox 52 during driver.quit() @ Win 7 Home Premium & GeckoDriver 0.14.0

Win 7 and FireFox is running in German language.
Win 7 has all available updates installed.

See also:

http://stackoverflow.com/questions/42672643/selenium-3-2-0-crashes-firefox-52-during-driver-quit-win-7-home-premium-ge

http://stackoverflow.com/questions/41989087/selenium-3-0-1-crashes-firefox-51-0-1-during-driver-quit-win-7-home-premium

@nico-wrl
Copy link

nico-wrl commented Mar 10, 2017

I've got the same issue: When trying to close the Firefox browser by means of org.openqa.selenium.WebDriver#quit(), Firefox crashes:

image

Log output:

1489141519437	geckodriver	INFO	Listening on 127.0.0.1:34152
1489141520010	mozprofile::profile	INFO	Using profile path D:\Users\NICOLA~1\AppData\Local\Temp\rust_mozprofile.nplU3UMINqIc
1489141520012	geckodriver::marionette	INFO	Starting browser C:\Apps\Firefox\firefox.exe with args []
1489141520046	geckodriver::marionette	INFO	Connecting to Marionette on localhost:57324
1489141521050	Marionette	INFO	Listening on port 57324
Mär 10, 2017 11:25:22 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
1489141524197	Marionette	INFO	New connections will no longer be accepted
[Child 9516] ###!!! ABORT: Aborting on channel error.: file c:/builds/moz2_slave/m-rel-w64-00000000000000000000/build/src/ipc/glue/MessageChannel.cpp, line 2143
Mär 10, 2017 11:25:25 AM org.openqa.selenium.os.UnixProcess destroy
SEVERE: Unable to kill process with PID 8140

Progamming language: Java
Selenium version: 3.3.0
geckodriver version: 0.15.0 64-bit
Firefox version: 52.0 64-bit
OS: Windows 7 Enterprise SP1 64-bit

@zenonwch
Copy link

Faced the same issue with driver.quit(); on MacOS X Sierra 10.12.3
screen shot 2017-03-10 at 12 37 52
firefox 51.0.1, 52.0.0
js binding of selenium-webdriver@3.3.0
geckodriver 0.14 and 0.15

@snpanigrahi9
Copy link
Author

Today I tested with gecko driver 0.15 and selenium client library 3.3.0
Firefox 52.0

Still its not closing the browser using driver.close();

@JoeStoner
Copy link

JoeStoner commented Mar 10, 2017

Still the same problem:

Selenium 3.3.0 crashes FireFox 52 during driver.quit() @ Win 7 Home Premium & GeckoDriver 0.15.0

http://stackoverflow.com/questions/42726413/selenium-3-3-0-crashes-firefox-52-during-driver-quit-win-7-home-premium-ge

@SankySyS
Copy link

I have no problem with closing the browser using Selenium 3.3.1 & FF 52 & GeckoDriver 0.15 and

@snpanigrahi9
Copy link
Author

3.3.1 is not released...

@snpanigrahi9
Copy link
Author

Hi SanKySys

I tried with 3.3.1, firefox 52.0 and gecko driver 0.15.0.
Still driver.close() is not working.

package sel;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.remote.DesiredCapabilities;

public class Close {

public static void main(String[] args) {
	// TODO Auto-generated method stub
	DesiredCapabilities caps = new FirefoxOptions()
		       // For example purposes only
		      .setProfile(new FirefoxProfile())
		      .addTo(DesiredCapabilities.firefox());
	      caps.setCapability("acceptInsecureCerts", true);
	      caps.setCapability("marionette", true);
	      String path = System.getProperty("user.dir");
	      String DriverPath = path+"//geckodriver.exe";
	      System.setProperty("webdriver.gecko.driver", DriverPath );
		  WebDriver driver = new FirefoxDriver(caps);
		  driver.get("https://www.healthkart.com/");
		  driver.close();
		  
		  
		  
		  
}

}

@snpanigrahi9
Copy link
Author

os platform

Windows 7 64 bit..

@pattyma
Copy link

pattyma commented Mar 14, 2017

I see the same issue.
I am on Windows 7 64 bit & Firefox 52 & Selenium 3.3.1 & geckodriver-v0.15.0-win64.
Firefox isn't closed when I use "driver.close()".
And when I use "driver.quit()", unexpected alert says that "Firefox has stopped working", and the error in my eclipse says " Unable to kill process with PID 1764"

@snpanigrahi9
Copy link
Author

SankySyS
Can you describe how did you solved it?

@joeldavuk
Copy link

joeldavuk commented Mar 14, 2017

For anyone else having the issue not a fix, but a workaround is to terminate the webdriver and browser via cli.

@snpanigrahi9
Copy link
Author

This is not a proper solution at all @joeldavuk

@pbi-qfs
Copy link

pbi-qfs commented Mar 15, 2017

I could reproduce the problem on my Windows 8.1 machine, find the root cause and probably provide a fix. The root cause is the new multi-process architecture of Firefox.

If you close the outer process (= shell) before the inner one (= tab) (you can simulate it with Task Manager on the affected machines you see two FF processes coming up), you get the crash. Geckodriver is doing exactly that, it's killing the FF (outer) process, when it should first kill the inner ones, than the outer one (or even better: FF should cleanly shutdown on main process kill)

Until then, you can disable the one-tab-per-process behavior in your tests by setting the right keys in your Firefox profile:

firefoxProfile.setPreference("browser.tabs.remote.autostart", false);
firefoxProfile.setPreference("browser.tabs.remote.autostart.1", false);
firefoxProfile.setPreference("browser.tabs.remote.autostart.2", false);

Works on my machine.

@annerajb
Copy link

@pbi-qfs

After you use those preferences when you run about:support on that firefox window does it show use multi process window disabled?

I tried it on the c# webdriver and the settings/preferences appear not to have taken effect.

@jmatias
Copy link

jmatias commented Mar 15, 2017

@annerajb make sure that you are using FirefoxOptions.

FirefoxOptions options = new FirefoxOptions();
options.SetPreference("browser.tabs.remote.autostart", false);
options.SetPreference("browser.tabs.remote.autostart.1", false);
options.SetPreference("browser.tabs.remote.autostart.2", false);

@annerajb
Copy link

Got it working by adding this at the end:

options.SetPreference("browser.tabs.remote.force-enable", "false");

in addition to what @jmatias and @pbi-qfs mentioned

@JoeStoner
Copy link

Thanks a lot Pascal / pbi-qfs, Javier / jmatias and annerajb - after waiting for more than 3 months for a solution this is a good workaround.

My entire code now - working fine:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;

public class SeleniumFireFoxMinimal {

public static void main(String[] args) throws InterruptedException {     
                                                                          
    System.setProperty("webdriver.gecko.driver", "e:\\geckodriver.exe");
                                                                        
    FirefoxProfile profile = new FirefoxProfile();
                                                                       
    profile.setPreference("browser.tabs.remote.autostart", false);
    profile.setPreference("browser.tabs.remote.autostart.1", false);
    profile.setPreference("browser.tabs.remote.autostart.2", false);
                                                                      
    profile.setPreference("browser.tabs.remote.force-enable", "false");
                                                                     
    WebDriver driver = new FirefoxDriver(profile);                  
                                                                       
    driver.get("http://www.toolsqa.com");                    
                                                                      
    Thread.sleep(5000);                                   
                                                                     
    driver.quit();                                        
                                                                 
}                                                            

}

@snpanigrahi9
Copy link
Author

@JoeStoner

is it working for driver.close() as well?

@snpanigrahi9
Copy link
Author

Below code is not working for me.

package demo1;

import java.io.IOException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.remote.DesiredCapabilities;

public class Automation {

public static void main(String[] args) throws InterruptedException, IOException {
	
    FirefoxProfile profile = new FirefoxProfile();
    profile.setPreference("browser.tabs.remote.autostart", false);
    profile.setPreference("browser.tabs.remote.autostart.1", false);
    profile.setPreference("browser.tabs.remote.autostart.2", false);                                                                  
    profile.setPreference("browser.tabs.remote.force-enable", "false");

	System.setProperty("webdriver.gecko.driver","C:\\Workspace\\Demo\\geckodriver.exe");
	WebDriver driver = new FirefoxDriver(profile);
	driver.get("http://www.toolsqa.com");
	driver.close();
	
		

	}

}

@JoeStoner
Copy link

Of course we have to keep in mind that FireFox is now running in the old Single-Task-Mode, but our customer will (soon) use / is using the Multi-Threaded-Version of FireFox ...

So this kind of testing is for sure not enough - maybe it's even worthless ...

Hopefully we will get asap a fix for this bug - whoever is responsible for it / FireFox / GeckoDriver / Selenium.

@andreastt
Copy link
Contributor

The Aborting on channel error problem is duplicated by #285 and the plugin container starting, causing it, is covered by #225.

@lock
Copy link

lock bot commented Aug 17, 2019

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have run into an issue you think is related, please open a new issue.

@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests