34
votes

I'm getting a Chrome Driver related error when running my Selenium tests. The error message is "Unable to Discover Open Pages." The Selenium tests were all running fine until last evening. The problem seemed to begin after a reboot of the server the day before. I cannot reproduce this error on my local box. Running the Selenium tests from the command line on the server does open the Chrome Browser but results in the same error. Any ideas?

Line that is failing:

chromeDriver = new OpenQA.Selenium.Chrome.ChromeDriver(externalDriverPath);

Error message and stacktrace:

unable to discover open pages (Driver info: chromedriver=2.1,platform=Windows NT 6.1 SP1 x86_64) at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) at OpenQA.Selenium.Chrome.ChromeDriver..ctor(String chromeDriverDirectory, ChromeOptions options) at OpenQA.Selenium.Chrome.ChromeDriver..ctor(String chromeDriverDirectory) at SeleniumTests.BaseTest.SetupBrowsers()

When creating an instance of the ChromeDriver, a console window appears. The server with the error seems to refer to things NOT IMPLEMENTED.

ChomeDriver Output From the Server with the Error:

Started ChromeDriver (v2.1) on port 2984 [4700:4292:0108/111503:ERROR:gpu_info_collector_win.cc(102)] Can't retrieve a va lid WinSAT assessment. [4700:4292:0108/111503:ERROR:chrome_views_delegate.cc(176)] NOT IMPLEMENTED [4700:4292:0108/111503:ERROR:desktop_root_window_host_win.cc(746)] NOT IMPLEMENT ED [0108/111504:ERROR:gl_surface_egl.cc(132)] eglInitialize failed with error UNKNO WN [0108/111504:ERROR:gl_surface_win.cc(97)] GLSurfaceEGL::InitializeOneOff failed.

ChomeDriver Output From My PC which works fine:

Started ChromeDriver (v2.1) on port 18786 [884540:883760:0108/114010:ERROR:gpu_info_collector_win.cc(102)] Can't retrieve a valid WinSAT assessment. [884992:884996:0108/114010:ERROR:base_feature_provider.cc(122)] manifestTypes: A llowing web_page contexts requires supplying a value for matches. [885232:885236:0108/114011:ERROR:base_feature_provider.cc(122)] manifestTypes: A llowing web_page contexts requires supplying a value for matches. [884540:883760:0108/114011:ERROR:base_feature_provider.cc(122)] manifestTypes: A llowing web_page contexts requires supplying a value for matches. [0108/114011:ERROR:gl_surface_egl.cc(131)] eglInitialize failed with error UNKNO WN [0108/114011:ERROR:gl_surface_win.cc(54)] GLSurfaceEGL::InitializeOneOff failed.

8

8 Answers

32
votes

You are using a highly outdated version of the ChromeDriver. Your first port of call should be to update it here.

I would highly suspect the problem is your Chrome on your server has updated, and ChromeDriver v2.1 doesn't support any recent versions of Chrome.

14
votes

Look here for other possible solutions: https://groups.google.com/forum/?hl=en#!topic/selenium-users/gfvfH-YEC48

In my case, adding the --no-sandbox argument to ChromeOptions solved the problem.

8
votes

Here's a quick workaround I found while digging around to get rid of that error: unknown error: unable to discover open pages

In your protractor config file, add the following:

 capabilities: {
    browserName: 'chrome',
    chromeOptions: {
      args: ['--no-sandbox']
    }   
},

The most important line there is the --no-sandbox; adding that line somehow gets rid of that error.

I am not exactly sure why it works but it's a workaround I found while digging around online.

***********************************UPDATES as of 10/04/2016***********************************

Please ignore this part right above as that workaround is NOT a proper fix; below I show you the actual fix to your problem; you just have an outdated chrome driver and running "webdriver-manager update" will only update up to v2.22 so I'll show you how to grab v2.24 right below.


Read on if your webdriver-manager update doesn't update chromedriver to the latest i.e past v2.22 OR to v2.24 as of 10/04/2016.

I lost a few weeks pulling my hair around an issue I had with "Unable to discover open pages" and every time I would update the chromedriver, it would update to version 2.22 for chromedriver and I believe the selenium server to v2.53. My problem wasn't really with the selenium server so v2.53 was fine.

Issue was with chromedriver v2.22. 

Eventhough this chromdriver link showed that there was a latest version of 2.24, 'webdriver-manager update' would NOT pick up that latest version, it would only grab version 2.22 of the chrome driver.

How did I go around this?

Simply run the command below after you check this link for which version of chromedriver you want to update to; for instance, I wanted v2.24 so I ran the command below:

webdriver-manager update --versions.chrome 2.24

If you check your location: C:\Users\<USER>\AppData\Roaming\npm\node_modules\webdriver-manager\selenium\

You should see that the desired chromedriver was downloaded there; if it's not there, read the command prompt logs and it'll tell you where it downloaded your chromdriver files.

Hope that helps someone!

4
votes

I had the same problem, but updating to the latest ChromeDriver (v2.8) did not solve it for me. I was running Selenium on a CI server (A Dell machine running 64 bit Win 7). I got the exception every time when the server had been 'idle' for a while.

What fixed the problem for me was to set 'Turn off display after' in Windows' Power Options to 'Never'.

1
votes

I am running selenium with python in Docker on a Google compute instance. For me, the issue was that my instance didn't have enough memory, and my scrape job would fail with this error. Upgrading it to g1-small resolved the issue for me.

0
votes

First make sure you have updated you chrome browser, through the Menu UI.

Then update ChromeDriver, here.

0
votes

For some reason the Chrome driver cannot interpret https traffic. If you change your link to http it will work nicely.

0
votes

In my case the problem was due to one of my colleagues, who started his tests at the same time on the same server, so that my web driver could not access the Chrome executable. It also happens if someone didn't finish his web driver process properly, in this case you have to kill it manually.