0
votes

I am using chrome browser in selenium project.

Here is the user agent string that I am using:

System.setProperty("webdriver.chrome.driver","C:\\users\\..\\chromedriver.exe");
driver = new ChromeDriver();            

What happens IF I run the script:

It open the chrome browser and after some time it close it and giving error:

org.openqa.selenium.WebDriverException: unknown error: unable to discover open pages (Driver info: chromedriver=2.2,platform=Windows NT 6.1 x86) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 26.83 seconds Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:12:12' System info: host: 'QAVM-9', ip: '27.101.1.26', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_45' Driver info: org.openqa.selenium.chrome.ChromeDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216) at org.openqa.selenium.chrome.ChromeDriver.startSession(ChromeDriver.java:182) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:111) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:115) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:161) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:150) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:139)

Please help me, It completely stop the execution. Let me know in case need any other information.

2

2 Answers

2
votes

I would suggest you to update your chrome driver since your version is 2.2 and the latest is 2.9. It might be possible that your existing chrome driver might not be supporting your chrome browser if the browser is of latest version.

  • Chrome driver versions are here
  • Also check the release notes here. Each chromedriver mentions which chrome browser versions it supports.
0
votes

Here's what I did 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.