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

driver.quit(); throwing an Exception #4678

Closed
prasanna532 opened this issue Sep 11, 2017 · 9 comments
Closed

driver.quit(); throwing an Exception #4678

prasanna532 opened this issue Sep 11, 2017 · 9 comments

Comments

@prasanna532
Copy link

Selenium v3.5.3
Firefox v55.0.3

org.apache.commons.exec.ExecuteException: The stop timeout of 2000 ms was exceeded (Exit value: -559038737)
at org.apache.commons.exec.PumpStreamHandler.stopThread(PumpStreamHandler.java:295)
at org.apache.commons.exec.PumpStreamHandler.stop(PumpStreamHandler.java:181)
at org.openqa.selenium.os.UnixProcess.destroy(UnixProcess.java:137)
at org.openqa.selenium.os.CommandLine.destroy(CommandLine.java:153)
at org.openqa.selenium.remote.service.DriverService.stop(DriverService.java:220)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:94)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:646)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:703)
at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:542)

@prasanna532 prasanna532 changed the title Driver Quit throwing an Exception driver.quit(); throwing an Exception Sep 11, 2017
@barancev
Copy link
Member

For issues please provide a concise reproducible test case and describe what results you are seeing and what results you expect.

See CONTRIBUTING.md

@daniilmeranov
Copy link

daniilmeranov commented Sep 14, 2017

System

Version: v0.18.0
Platform: Windows 7, 32 bit
Firefox: 55.0.3
Selenium: 3.5.3
Java: 1.8.0_144

Testcase

using System;
using System.Threading;
using System.Windows.Forms;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Remote;

namespace testFirefox
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var profile = new FirefoxProfile();
            profile.SetPreference("browser.download.folderList", 2);
            //0-desktop,1-file download folder,2-specified location
            //Set downloadPath
            profile.SetPreference("browser.download.dir", "C:\\Temp");
            //Set File Open & Save preferences
            profile.SetPreference("browser.helperApps.neverAsk.openFile",
    "text/csv,application/x-msexcel,application/excel,application/x-excel,application/vnd.ms-excel,image/png,image/jpeg,text/html,text/plain,application/msword,application/xml,text/comma-separated-values,application/octet-stream");
            profile.SetPreference("browser.helperApps.alwaysAsk.force", false);
            profile.SetPreference("browser.download.manager.alertOnEXEOpen", false);
            profile.SetPreference("browser.download.manager.focusWhenStarting", false);
            profile.SetPreference("browser.download.manager.useWindow", false);
            profile.SetPreference("browser.download.manager.showAlertOnComplete", false);
            profile.SetPreference("browser.download.manager.closeWhenDone", true);
            profile.SetPreference("browser.download.panel.shown", false);
            profile.SetPreference("general.useragent.locale", "en-GB");
            var mfOptions = new FirefoxOptions
            {
                Profile = profile,
                LogLevel = FirefoxDriverLogLevel.Trace
            };
            var capabilities = (DesiredCapabilities)mfOptions.ToCapabilities();
            var remoteDriver = new RemoteWebDriver(new Uri(ConfigSettingsReader.HubUrl), capabilities);
            remoteDriver.Manage().Window.Size = new System.Drawing.Size(Screen.PrimaryScreen.Bounds.Width,
            Screen.PrimaryScreen.Bounds.Height);
            remoteDriver.Navigate().GoToUrl(ConfigSettingsReader.AppUrl);
            Thread.Sleep(1000);
            remoteDriver.Quit();
        }
    }
}

where
HubUrl: "http://localhost:5555/wd/hub"
AppUrl: "http://google.com"

Expected Behaviour:

Browser is closed, driver is finished

Actual behaviour:

Firefox is finished with crash.
Node shows:

1505376224318   geckodriver::marionette TRACE   <- [1,97,null,{"value":12}]
1505376224318   webdriver::server       DEBUG   <- 200 OK {"value":12}
1505376224401   webdriver::server       DEBUG   -> DELETE /session/9f078b12-f3fb-4765-b2e1-3e5718e9e32b
1505376224401   geckodriver::marionette TRACE   -> 38:[0,98,"quit",{"flags":["eForceQuit"]}]
1505376224588   Marionette      TRACE   0 <- [1,98,null,{"cause":"shutdown"}]
1505376224615   geckodriver::marionette TRACE   <- [1,98,null,{"cause":"shutdown"}]
1505376224616   webdriver::server       DEBUG   Deleting session
1505376224616   geckodriver::marionette DEBUG   Stopping browser process
1505376224757   webdriver::server       DEBUG   <- 200 OK {"value": {}}
11:03:44.758 INFO - To downstream: {"value": {}}
11:03:44.761 INFO - Removing session org.openqa.selenium.remote.server.ServicedSession@2e9a60
1505376224765   webdriver::server       DEBUG   -> DELETE /session/9f078b12-f3fb-4765-b2e1-3e5718e9e32b
1505376224768   webdriver::server       DEBUG   <- 500 Internal Server Error {"value":{"error":"session not created","message":"Tried to ru11:03:44.769 INFO - To downstream: {"value":{"error":"session not created","message":"Tried to run command without establishing a connection","stacktrace":"stack backtrace:\n   0:   0x4e6bd4 - <no info>\n   1:   0x43e926 - <no info>\n   2:   0x4295aa - <no info>\n   3:   0x40619b - <no info>\n   4:   0x40bf07 - <no info>\n   5:   0x69d92b - <no info>\n   6:   0x420476 - <no info>\n   7:   0x6989e1 - <no info>\n   8: 0x753538f4 - BaseThreadInitThunk\n   9: 0x779d5de3 - RtlUnicodeStringToInteger"}}
n command without establishing a connection","stacktrace":"stack backtrace:\n   0:   0x4e6bd4 - <no info>\n   1:   0x43e926 - <no info>\n   2:   0x4295aa - <no info>\n   3:   0x40619b - <no info>\n   4:   0x40bf07 - <no info>\n   5:   0x69d92b - <no info>\n   6:   0x420476 - <no info>\n   7:   0x6989e1 - <no info>\n   8: 0x753538f4 - BaseThreadInitThunk\n   9: 0x779d5de3 - RtlUnicodeStringToInteger"}}
1505376224789   webdriver::server       DEBUG   -> GET /shutdown
1505376224793   webdriver::server       DEBUG   <- 404 Not Found {"value":{"error":"unknown command","message":"GET /shutdown did not match a known command","stacktrace":"stack backtrace:\n   0:   0x4e6bd4 - <no info>\n   1:   0x43e83c - <no info>\n   2:   0x438a45 - <no info>\n   3:   0x404310 - <no info>\n   4:   0x40bf30 - <no info>\n   5:   0x69d92b - <no info>\n   6:   0x42061e - <no info>\n   7:   0x6989e1 - <no info>\n   8: 0x753538f4 - BaseThreadInitThunk\n   9: 0x779d5de3 - RtlUnicodeStringToInteger"}}
11:03:46.122 ERROR - Unable to kill process with PID 15036

@shs96c
Copy link
Member

shs96c commented Sep 14, 2017

The two stack traces differ quite a lot. The first one seems to be from the java side of things, but this last one appears to be someone calling geckodriver's (non-existent) shutdown handler.

Are you using geckodriver directly? The selenium-standalone server? Grid?

@daniilmeranov
Copy link

I use selenium-server-standalone-3.5.3.jar
Hub: java.exe -jar "%TestTools%\Selenium\selenium-server-standalone-3.5.3.jar" -role hub
Node: java.exe -jar "%TestTools%\Selenium\selenium-server-standalone-3.5.3.jar" -role node -hub http://localhost:4444/grid/register

HubUrl from app.config contains: "http://localhost:5555/wd/hub"
geckodriver.exe located in available folder (included to path)

@daniilmeranov
Copy link

I updated testcase block with full source code I ran.
Project is used following packages from NuGet:

  <package id="Selenium.Support" version="3.5.2" targetFramework="net462" />
  <package id="Selenium.WebDriver" version="3.5.2" targetFramework="net462" />

@barancev
Copy link
Member

barancev commented Sep 14, 2017

Can you retest with a newer Firefox version, e.g. Developer Edition?
https://www.mozilla.org/firefox/developer/

@daniilmeranov
Copy link

Yes, Dev Edition (56.0b11) works stable. Thank you! Is it Firefox 55 kernel issue?

@barancev
Copy link
Member

Yes, seems to be a browser issue.

@JoeStoner
Copy link

Selenium 3.12 shows an error on driver.quit() @ FireFox 60 / Win 7 Home Premium / Java 10.0.1 / GeckoDriver 0.20.1

Please see all details here / Thanks a lot:

https://stackoverflow.com/questions/50305819/selenium-3-12-shows-an-error-on-driver-quit-firefox-60-win-7-home-premium

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

No branches or pull requests

5 participants