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

Detect browser crash #3028

Closed
alexamirante opened this issue Oct 28, 2016 · 2 comments
Closed

Detect browser crash #3028

alexamirante opened this issue Oct 28, 2016 · 2 comments

Comments

@alexamirante
Copy link

Meta -

OS: Linux Ubuntu 14.04

Selenium Version: 3.0.1

Browser: Chrome

Browser Version: 54.0.2840.71

Expected Behavior -

I'm trying to get notified of browser crashes by periodically issuing a webDriver.getTitle(). I would expect it to throw a WebDriverException as soon as the browser is not reachable.

Actual Behavior -

A WebDriverException, is actually thrown when the browser is not reachable, but only after ~2 minutes (127 seconds). I guess some timeout fires at that point.

Is such timeout configurable somewhere? I tries the various WebDriver.Timeouts but had no effect.

Steps to reproduce -

Through the Java bindings:

    WebDriver webDriver = new ChromeDriver();
    webDriver.get("https://www.google.com");
    while(true) {
        try {
            webDriver.getTitle();
            Thread.sleep(1000);
        } catch(WebDriverException | InterruptedException e) {
            e.printStackTrace();
            break;
        }
    }
@barancev
Copy link
Member

  1. It depends on the driver, chromedriver namely, so you have to report the issue to their tracker.

  2. I can't reproduce the issue, I've added some tracing:

    WebDriver webDriver = new ChromeDriver();
    webDriver.get("https://www.google.com");
    while(true) {
        try {
            System.out.println("peep " + System.currentTimeMillis());
            webDriver.getTitle();
            Thread.sleep(1000);
        } catch(WebDriverException | InterruptedException e) {
            System.out.println("crack! " + System.currentTimeMillis());
            e.printStackTrace();
            break;
        }
    }

and the output shows that the timeout is about 3 seconds:

Starting ChromeDriver 2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed) on port 14357
Only local connections are allowed.
окт 29, 2016 8:48:16 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
окт 29, 2016 8:48:16 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
peep 1477763297656
peep 1477763298662
peep 1477763299667
peep 1477763300672
peep 1477763301693
peep 1477763302698
peep 1477763303704
peep 1477763304709
crack! 1477763307740
org.openqa.selenium.WebDriverException: chrome not reachable
(Session info: chrome=54.0.2840.71)
(Driver info: chromedriver=2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3.03 seconds
Build info: version: '3.0.0', revision: '350cf60', time: '2016-10-13 10:48:57 -0700'
System info: host: 'alexei-pc', ip: '169.254.47.71', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_91'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed), userDataDir=C:\Users\alexei\AppData\Local\Temp\scoped_dir5396_3594}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=54.0.2840.71, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]

@alexamirante
Copy link
Author

Forgot to say that I tested it on Windows myself, and it doesn't happen. The 2 minutes delay only happens on Linux (at least on Ubuntu 14.04).

I'll report the issue to the chromedriver tracker, thanks.

@lock lock bot locked and limited conversation to collaborators Aug 19, 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

2 participants