When the final window is closed, Firefox experiences crashes related to the driver

When working on a project, I sometimes find myself using multiple FF windows and drivers. To initialize, I create a personalized FirefoxProfile or use a default one from Selenium without any modifications. I then add it to DesiredCapabilities, include the capabilities in FirefoxOptions, and start FF with FirefoxOptions.

The test case runs smoothly until I reach the point where I need to close the window:

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

or

driver.quit();

After either of these actions, FF closes down and a "Firefox has crashed" popup appears. However, there are no exceptions shown in the logs.

https://i.stack.imgur.com/DdLpK.png

If I remove the FirefoxProfile, the crash popup disappears. But the FirefoxProfile is necessary for enabling Flash support and additional functionalities.

Tools used:

  • Selenium 3.4.0
  • Firefox 54 (32 bit)
  • Geckodriver 0.17 (32 bit)
  • Windows 10, 64bit // Windows 7, 64bit

Answer №1

The driver is struggling to properly terminate the subprocesses generated by Firefox, such as flash.

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

To prevent the appearance of the dialogue box, you have the option to set the environment variable XRE_NO_WINDOWS_CRASH_DIALOG to 1.

Answer №2

Yes, I encountered the exact same error. I experimented with different solutions but none of them worked except for reverting back to an older version of Firefox.

Currently using version 46.01 and haven't experienced any crashing problems since then.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is it possible to split and execute TestNG tests in portions instead of running the entire suite at once?

I am facing an issue with my testng.xml file where most of the tests are failing due to timing problems. However, when I run them in smaller chunks, they work fine. One solution I attempted was dividing the small number of tests into multiple testng.xml f ...

Steps to resolve maven org.apache.maven.surefire.testset.TestSetFailedException:

As I work on setting up my project on the server, running my Maven project using mvn test is resulting in an error. I have ensured that everything is set up correctly, but I am still unable to determine where the mistake lies. org.apache.maven.surefire.t ...

Spring does not perform validation on JSON requests

Whenever I make the following request: "Person": { "name": 5 } The request will fail as it is a bad request since 5 is not a string. It displays: Person{name='5'}. Similarly, no error occurs when null is sent. The annot ...

How to handle timeout events with Ruby Selenium framework

Is there a method in Ruby Selenium to capture all timeout error events? I am currently configuring Jenkins with Selenium, but I am unsure of the most effective way to stop building tasks between steps. The only solution I have come across so far is insert ...

What is the best way to extract information from a webpage that contains both static and dynamic elements?

After using a headless browser, I found that the suggested solution to a similar question did not address my specific problem. The provided answer lacked details on effectively utilizing a headless browser for the task at hand. The target webpage for scra ...

Tips for capturing test outcomes utilizing Dataprovider in Selenium and storing them in an Excel sheet

I've been attempting to store the output of a calculator operation in an Excel spreadsheet, but I'm struggling to come up with a logical way to loop through the rows and columns depending on the number of test cases. (I hope that explanation make ...

Adding a log file to an Azure DevOps Test Execution

I have been encountering difficulties when trying to upload the log file generated from my automated tests in the Azure Release pipeline. My automated UI tests are conducted using selenium and MSTest. Initially, I believed that I could attach the file in t ...

Is it better to use one assert or multiple asserts in each Selenium test case?

When creating automated smoke tests, I have come across conflicting information about the use of multiple asserts in unit tests. Is it considered a bad practice to have more than one assert in webdriver tests with Selenium as well? In my smoke tests, I of ...

Navigating to an iframe window within a single window on a Windows application

Initially, I attempted to use driver.switchTo().frame("framename"); but unfortunately it did not successfully switch to the desired frame. driver.switchTo().frame("xxx");/// Throws an {"status":7,"value":{"error ...

Java code for Selenium WebDriver to wait for cookies and local database cookies

In Java, I utilize Selenium to access cookies from the local database. However, when using the following code snippet to wait for the site to be fully loaded, I do not receive all the cookies: webDriverWait.until(webDriver -> "complete".equals ...

Is it recommended to have a single repository for iOS and Android when creating automation for mobile applications (Native App)?

At the moment, I am utilizing Appium, Selenium, Java, and TestNG for automating a native app. My focus is on iOS and Android platforms, where the functionalities are similar but the element identification process differs between the two. Each element has a ...

Setting up Geb 2.0 in IntelliJ: A Step-by-Step Guide for Run/Debug Configurations

I've been exploring Geb 2.0 at http://gebish.org/ and I recently downloaded the Gradle sample from https://github.com/geb/geb-example-gradle. Everything is running smoothly on my machine with various browsers like Chrome, Firefox, and ChromeHeadless. ...

Finding the "send item" button in Outlook Office with the help of Chromedriver

Hey there, I'm having some trouble clicking on the "New Group" option in the office365 menu using chromedriver with selenium. Unfortunately, when I try to run the script I created, it doesn't seem to be working as expected. Here is a screenshot s ...

Automated test does not trigger Selenium Webdriver modal popup

Currently, I am developing automation scripts using Selenium Webdriver in Java to test an application designed for Point of Sale systems. Upon the initial launch of the application, a modal dialog box is displayed for the user to make a selection. This mo ...

what is the best method to locate a parent element containing a particular child using By.xpath()?

In the past few days, I've been utilizing the selenium-webdriver in nodejs for web scraping. However, I am facing an issue on how to locate an element that contains a specific child element. I have attempted to use the following operator but it does ...

Selenium objects disappear from view

My selenium test is currently running smoothly at a resolution of 1920 * 1080. However, I have been tasked with adapting this test to work on different common resolutions, such as 1366 * 768. The issue arises when running the Selenium test on smaller reso ...

Navigating a webpage and interacting with elements within a different class using the Page Object Model (POM) in

I am currently working on a project with both a landing page and a registration page. While I have successfully stored the web elements from the landing page using @FindBy annotations, I now need to access these elements on the registration page. What st ...

Having trouble finding an element with Python Selenium after switching to a frame in Firefox browser?

I'm facing difficulty locating the element within the frame even after switching to the correct frame. Below is my code, error message, and HTML source. When I right-click on the frame and choose This Frame -> Show Only This Frame, I can find the e ...

Unable to convert the text string into my desired object

The JSON string I received has been validated by jsonlint. A decodedCookie string is created using URLDecoder to decode the value of myCookie in UTF-8 format, and then Gson is used to parse it. Here is what the string looks like: { "urlAW": "http://w ...

Extracting information from Trading View with the help of Selenium

I'm facing a challenge while attempting to web scrape data from a trading view chart using an infinite loop – I keep encountering the StaleElementReferenceException error. Despite my efforts to address this by making the program wait explicitly, I r ...