38

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.

James Lawruk
  • 30,112
  • 19
  • 130
  • 137

9 Answers9

37

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.

Huniku
  • 155
  • 2
  • 8
Arran
  • 24,648
  • 6
  • 68
  • 78
15

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.

patty
  • 313
  • 2
  • 8
  • 1
    Updated the ChromeDriver and Selenium drivers and even set the running user to be a local administrator but what finally fixed it was the no-sanbox option. – Karlth Jul 21 '16 at 12:07
  • had a similar problem, with multiple Threads and a limited degree of parallelism. came to is this exception, when one of the first was finished and the next Thread opens a new chromedriver. also fixed by --no-sandbox – user3104267 Nov 27 '20 at 10:56
9

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!

pelican
  • 5,846
  • 9
  • 43
  • 67
  • I am running a headless chrome instance on Windows with ruby Selenium _and using the latest versions_ (**chrome 67, chromedriver 2.39**). Adding the "--no-sandbox" arg solved the "Unable to Discover Open Pages." issue for me. – rogersillito Jun 15 '18 at 12:25
  • Where do I find the "protractor config file"? – Yaser Sakkaf May 19 '23 at 05:41
4

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'.

Michael Herrmann
  • 4,832
  • 3
  • 38
  • 53
2

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.

antonky
  • 768
  • 1
  • 8
  • 14
1

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.

Roman Dornhof
  • 169
  • 2
  • 3
  • 18
0

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

Then update ChromeDriver, here.

Peter Kogan
  • 101
  • 3
0

May be it is too late to answer this question. But I was facing the same issue on intelij and GEB. That has inbuild selenium libs.

Now i was facing issue for very long time. I at last just uninstall the Intelij and installed in back. Then i imported project from start.

That some how worked for me. I was using latest Selenium and Chromedriver.

Kishan Bheemajiyani
  • 3,429
  • 5
  • 34
  • 68
-1

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

Adriaan Joubert
  • 185
  • 1
  • 4
  • 15
0n10n_
  • 382
  • 3
  • 10