Selenium ChromeDriver unknown error unable to discover open pages

7,666 views
Skip to first unread message

rscruicksh...@gmail.com

unread,
May 31, 2016, 5:51:31 AM5/31/16
to Selenium Users

I need help with setting up ChromeDriver in Selenium WebDriver.

I have downloaded the latest version of ChromeDriver and added the path to the exe to my PATH environment variable. Trying to run the following piece of code to set a new instance of ChromeDriver:


File file = new File("C:\\eclipse\\chromedriver.exe"); 

System.setProperty("webdriver.chrome.driver", file.getAbsolutePath()); 

System.setProperty("webdriver.chrome.logfile", "C:\\eclipse\\chromedriver.log");

driver = new ChromeDriver();

driver.get("google.com");


However, when I try to run any scripts they fail on the line

driver = new ChromeDriver();

An instance of Chrome opens with a black screen and the address set as "data;," and I get a popup stating:

"Chrome Automation Extension has crashed".

Continuing from that point, I get the following exception details:

unknown error: unable to discover open pages

(Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 61.19 seconds

Build info: version: '2.52.0', revision: '4c2593c', time: '2016-02-11 19:03:33'

As I say, I've got the latest version of ChromeDriver and I have checked that Chrome is currently running the latest version so I know it isn't an issue with outdated versions of either.

I'm sure it must be something simple which I'm overlooking, but I just can't think what. Does anyone have any ideas?


Here's the log for the case:

[0.885][INFO]: COMMAND InitSession {
   "desiredCapabilities": {
      "browserName": "chrome",
      "chromeOptions": {
         "args": [  ],
         "extensions": [  ]
      },
      "platform": "ANY",
      "version": ""
   }
}
[0.886][INFO]: Populating Preferences file: {
   "alternate_error_pages": {
      "enabled": false
   },
   "autofill": {
      "enabled": false
   },
   "browser": {
      "check_default_browser": false
   },
   "distribution": {
      "import_bookmarks": false,
      "import_history": false,
      "import_search_engine": false,
      "make_chrome_default_for_user": false,
      "show_welcome_page": false,
      "skip_first_run_ui": true
   },
   "dns_prefetching": {
      "enabled": false
   },
   "profile": {
      "content_settings": {
         "pattern_pairs": {
            "https://*,*": {
               "media-stream": {
                      "audio": "Default",
                  "video": "Default"
               }
            }
         }
      },
      "default_content_setting_values": {
         "geolocation": 1
      },
      "default_content_settings": {
         "geolocation": 1,
         "mouselock": 1,
         "notifications": 1,
         "popups": 1,
         "ppapi-broker": 1
      },
      "password_manager_enabled": false
   },
   "safebrowsing": {
      "enabled": false
   },
   "search": {
      "suggest_enabled": false
   },
   "translate": {
      "enabled": false
   }
}
[0.889][INFO]: Populating Local State file: {
   "background_mode": {
      "enabled": false
   },
   "ssl": {
      "rev_checking": {   
         "enabled": false
      }
   }
}
[0.936][INFO]: Launching chrome: "C:\Program Files    (x86)\Google\Chrome\Application\chrome.exe" --disable-background-networking --disable-client-side-phishing-detection --disable-component-update --disable-default-apps --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-web-resources --enable-logging --ignore-certificate-errors --load-extension="C:\Users\Rory\AppData\Local\Temp\scoped_dir10152_5411\internal" --log-level=0 --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=12607 --safebrowsing-disable-auto-update --safebrowsing-disable-download-protection --test-type=webdriver --use-mock-keychain --user-data-dir="C:\Users\Rory\AppData\Local\Temp\scoped_dir10152_31299" data:,
[61.070][INFO]: RESPONSE InitSession unknown error: unable to discover open pages

Punkaaj Chavaan

unread,
Jun 1, 2016, 2:30:39 AM6/1/16
to Selenium Users

rscruicksh...@gmail.com

unread,
Jun 1, 2016, 4:04:57 AM6/1/16
to Selenium Users
The solutions given there are either an old version of software, which doesn't apply here as Selenium, ChromeDriver and Chrome are all up to date, or around running Jenkins service as an admin. I don't think that this applies either as I'm not running Jenkins, the tests are run from a local machine, directly through Selenium in Eclipse, which is being run as an administrator. Am I missing something in the setup which would allow this to run?

Purushotham Karimbedu

unread,
Jun 1, 2016, 7:14:54 AM6/1/16
to seleniu...@googlegroups.com
Hi rscruickshanknccgroup,
I have written sample script for launch the google chrome browser, follow these commands I think it will work to you. you just give the your chromedriver.exe file path.

---
Thanks & Regards,
Purushotham Karimbedu,
Drupal Developer and QA Engineer,
Phone no: 09000109120.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/e10b1718-4ec8-4659-a08e-11fc5cacd991%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

rscruicksh...@gmail.com

unread,
Jun 2, 2016, 3:36:14 AM6/2/16
to Selenium Users
Hi Purushotham,

I tried this and I'm still getting the same results. As soon as the script reaches the line "driver=new ChromeDriver();" I get the popup saying, "Chrome Automation Extension has crashed".

Thanks,
rory

Andrew Jervis

unread,
Jun 2, 2016, 6:30:41 AM6/2/16
to Selenium Users
The following works for me opening Chrome

However, the following opens Chrome as a Browser which may help

 

1. Download the latest Chrome driver installable from http://chromedriver.storage.googleapis.com/index.html

 

2. Unzip the file and run the Chromedriver.exe file. This should start the Chromedriver on port 9515

 

3. Install the Chrome Browser

 

4. In Selenium webdriver create a Class file and use the following code (adjust the location of the Chrome driver as appropriate

 

package Trainingpack;

 

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.chrome.ChromeDriver;

 

public class chrome1 {

  

    public static void main(String[] args) throws Exception {

 

    System.setProperty("webdriver.chrome.driver","c:\\ca\\chromedriver.exe");

      

    WebDriver driver = new ChromeDriver();

  

    driver.get("http://www.google.com");

  

    WebElement searchBox = driver.findElement(By.name("q"));

  

    searchBox.sendKeys(new String[] {"Chrome Driver"});

      

    }

 

}

 

You are crashing on the line

driver = new ChromeDriver();

Try WebDriver driver = new ChromeDriver();

⇜Krishnan Mahadevan⇝

unread,
Jun 2, 2016, 6:48:09 AM6/2/16
to Selenium Users
@Rory,

My guess is that perhaps there is something wrong with your chrome browser installation itself [ not chromedriver binary ].

So to confirm that, can you please try the following and let us know what you see ?


Assuming that chromedriver binary is available in your PATH variable, start the chromedriver binary manually by typing : chromedriver --verbose 

Now try running the below curl command (this is essentially what happens when java executes WebDriver driver = new ChromeDriver() )

curl --data "{\"desiredCapabilities\": {}}" --header "Content-type: application/json"  http://localhost:9515/session

Expected result : You should see a chrome browser window popup.

Also share the chromedriver logs [ we have asked the chromedriver to start up in a verbose mode, so its going to get a bit chatty ]

If you see the browser crash there as well, then you could try doing an uninstall of chrome browser itself and re-install and see if that helps by doing these things again.


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

rscruicksh...@gmail.com

unread,
Jun 2, 2016, 8:51:28 AM6/2/16
to Selenium Users
@Andrew, I tried as suggested and got the following:

Starting ChromeDriver 2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4) on port 5143
Only local connections are allowed.
log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited normally
  (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 61.11 seconds
Build info: version: '2.52.0', revision: '4c2593c', time: '2016-02-11 19:03:33'
System info: host: 'LT07741', ip: '192.168.99.207', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_73'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:159)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:116)
at automationTestCases.ChromeTest.main(ChromeTest.java:21)

I got the same results as before, with the same popup.

@Krishnan, this is after uninstalling Chrome, downloading a fresh copy and installing that. I tried as you have suggested, inputting the following in the command line:

:chromedriver --verbose 
:curl --data "{\"desiredCapabilities\": {}}" --header "Content-type: application/json"  http://localhost:9515/session
 
These commands were accepted in cmd, but nothing happened beyond that. I checked in Task Manager, to see if it had been started as a headless process, but still nothing.

⇜Krishnan Mahadevan⇝

unread,
Jun 2, 2016, 8:58:11 AM6/2/16
to Selenium Users
Did you see if the chromedriver's verbose logs revealed anything ?

If not anything else, I think its time that you take this up with the chromium project and see if they can help.. Atleast that is what this link suggests : https://sites.google.com/a/chromium.org/chromedriver/help/chrome-doesn-t-start

So maybe you can just run through all the alternatives that are suggested in the above mentioned link and see if anyone of them helps. If nothing happens then you may have to file an issue with the chromium project. 

There is definitely something else, which is causing the problem. Unfortunately I have to accept that I have now run out of ideas.


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

rscruicksh...@gmail.com

unread,
Jun 2, 2016, 9:24:36 AM6/2/16
to Selenium Users
Also, when launching chromeDriver.exe manually, this requires admin rights due to the security settings on my machine. I assume that these rights should be carried through from Selenium, which I always launch as an administrator.


Andrew Jervis

unread,
Jun 3, 2016, 9:39:48 AM6/3/16
to Selenium Users
When you tried my approach I note the line


Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited normally

I agree with Krishnan and the issue strongly points to your Chrome Installation which needs checking

You could test with different versions of the Chromedriver.exe
Reply all
Reply to author
Forward
0 new messages