Chrome Driver Error using Selenium: Unable to Discover Open Pages

Solution 1:

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.

Solution 2:

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.

Solution 3:

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!

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

Solution 5:

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.