mozilla / geckodriver

WebDriver for Firefox
https://firefox-source-docs.mozilla.org/testing/geckodriver/
Mozilla Public License 2.0
7.03k stars 1.51k forks source link

Aborting on channel error & Unable to kill process #494

Closed Candide7 closed 7 years ago

Candide7 commented 7 years ago

Firefox Version: 51.0.1 (updated the 24th of February, 2017)

Platform: Win10 64

Steps to reproduce -

Hello, I updated this morning all my libraries:

Now I run the same test as before and it seems to end correctly except in the traces:

Traces:

1487923697078   addons.manager  DEBUG   Provider finished startup: PreviousExperimentProvider
1487923697082   DeferredSave.extensions.json    DEBUG   Starting write
1487923697288   DeferredSave.extensions.json    DEBUG   Write succeeded
1487923697289   addons.xpi-utils    DEBUG   XPI Database saved, setting schema version preference to 19
févr. 24, 2017 9:08:18 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFOS: Detected dialect: W3C
[Child 9584] ###!!! ABORT: Aborting on channel error.: file c:/builds/moz2_slave/m-rel-w32-00000000000000000000/build/src/ipc/glue/MessageChannel.cpp, line 2056
févr. 24, 2017 9:08:21 AM org.openqa.selenium.os.UnixProcess destroy
GRAVE: Unable to kill process with PID 9412

Basically this is what I run:

System.setProperty("webdriver.gecko.driver", "Regulus_lib/geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
try {
   driver.quit();
} catch(org.openqa.selenium.remote.UnreachableBrowserException e) {
/* Since Selenium 3 and the use of Gecko, driver.quit() causes exception each time
 * Indeed gecko let a channel thread opened with the selenium webdriver.
 * To test again with future stable version.
 * Update: Gecko 0.14 seems to fix this problem. */
driver = null;
}

The problem seems to be related to the driver.quit(). Note that the Firefox Window closes correctly at the end. I tried to figure it out using driver.close() also but nothing good with it.

Am I doing womething wrong please?

Thanks for your help.

thasherwin commented 7 years ago

I have a work-around for this issue when running your test on selenium grid using firefox. Or when running it localy on your machine. I created a bat file that automatically kills the process after 5 min

You can also send a commando to kill your proces tskill WerFault after browser driver.quit();

@echo off cls :start echo This is a loop tskill WerFault TIMEOUT /T 300 goto start

Candide7 commented 7 years ago

Hello thasherwin and thanks for the response. Yes of course I could manually stop it but well it is not exactly a pretty solution. Especially in my case since my soft will be used by a third person.

thasherwin commented 7 years ago

Yes correct.. It's just a work-around untill Gecko team looks into this issue and solve it

robinsmathewgit commented 7 years ago

Adding my finding to this issue.

Browser : Firefox Nightly 54.0, Firefox 51.0 Selenium : 3.1.0 GeckoDriver : geckodriver-v0.14.0-win64

GeckoDriver is happy with most of the websites but it is crashing for some main websites.

Website Crashing

http://www.cnn.com/ http://www.dailymail.co.uk/ https://www.bet365.com/ http://www.foxnews.com/ http://abcnews.go.com/

Most of the other site I have checked worked without any problem

When driver.quit() is called it will show the message "Plugin container for Nightly stopped working"

Here is the message displayed in Firefox popup (For all the above websites its the same)

Problem signature: Problem Event Name: APPCRASH Application Name: plugin-container.exe Application Version: 54.0.0.6264 Application Timestamp: 58b02aac Fault Module Name: xul.dll Fault Module Version: 54.0.0.6264 Fault Module Timestamp: 58b029ef Exception Code: 80000003 Exception Offset: 008cb329 OS Version: 6.1.7601.2.1.0.256.4 Locale ID: 2057 Additional Information 1: 0a9e Additional Information 2: 0a9e372d3b4ad19135b953a78882e789 Additional Information 3: 0a9e Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Read our privacy statement online: http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline: C:\windows\system32\en-US\erofflps.txt

I am sharing the code I have used. This issue is consistent for any of the above websites.

Code

package CrossBrowser.Tests.POC;

import java.net.URL;

import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxProfile; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; import org.testng.annotations.Test;

public class GeckoDriverIssue {

WebDriver driver;

@Test(description = "Launch Website")
public void geckoDriverIssue() {        

    try {
        FirefoxProfile fp = new FirefoxProfile();
        DesiredCapabilities firefoxCapabilities = DesiredCapabilities.firefox();
        firefoxCapabilities.setCapability(FirefoxDriver.PROFILE, fp);
        firefoxCapabilities.setCapability("marionette", true);
        driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), firefoxCapabilities);

        String webSite = "http://www.cbsnews.com/";
        driver.get(webSite);

    } catch (Exception e) { }

    finally {
        driver.quit();  
    }

}

}

Thanks, Robins

andreastt commented 7 years ago

And this appears to be a duplicate of https://github.com/mozilla/geckodriver/issues/285.

robinsmathewgit commented 7 years ago

@Candide7 Can you check your code against Firefox Nightly its not crashing for www.google.com only few website its crashing.

Candide7 commented 7 years ago

But I don't crash like you do. I've just watched this issue: #285. I wil test Firefox v52.

andreastt commented 7 years ago

Locking this.