Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox crashes on driver last window close

I have a project that sometimes uses multiple FF windows and sometimes multiple FF drivers. During init, I create a custom FirefoxProfile (or load a default from Selenium without any changes), add it to DesiredCapabilities, add capabilities to FirefoxOptions and start FF with FirefoxOptions.

Test case executes fine, until I need to close the window:

driver.getWindowHandles().forEach(name -> driver.switchTo().window(name).close());

or

driver.quit();

After either one of these pass, FF shuts down and "Firefox has crashed" popup appears. No exception is shown in logs.

enter image description here

If I remove FirefoxProfile, no crash popup appears, but FirefoxProfile is needed to enable Flash support and do more.

Using:

  • Selenium 3.4.0
  • Firefox 54 (32 bit)
  • Geckodriver 0.17 (32 bit)
  • Windows 10, 64bit // Windows 7, 64bit
like image 890
Hans Avatar asked Jul 11 '17 07:07

Hans


People also ask

Why does my Mozilla Firefox keep crashing?

Some of the most common include the following; The Firefox browser could be outdated and may need an update. It is also possible that the version of Windows 10 you are running is not up to dare. Mismatched cache and other conflicts of settings can cause Firefox to crash.

What is Mozilla crash reporter?

The Mozilla Crash Reporter dialog box appears when Firefox closes unexpectedly and lets you submit a crash report to developers, to make future Firefox versions crash less often. This article describes how it works and shows you how to access your crash reports.

Is Firefox being discontinued?

Firefox is still very much alive and well as Mozilla has no plans to stop development of their web browsers for desktop (Windows, macOS, Linux) and mobile versions for iOS and Android. Firefox has been their main product.


1 Answers

The driver is failing to properly terminate the sub processes created by Firefox like flash.

https://github.com/mozilla/geckodriver/issues/285

To avoid the dialogue box, you can set the environemnt variable XRE_NO_WINDOWS_CRASH_DIALOG to 1.

like image 114
Florent B. Avatar answered Sep 28 '22 15:09

Florent B.