ericmckean / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

Failed to create browser instance for Selenium Node running in background #942

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Issue Description:

When launching Selenium node with chromedriver by Windows Task Scheduler, 
Selenium node fails to create a instance of Chrome browser on request. Selenium 
node and hub are running in background on behalf of my user (I can see their 
processes runnings with Task Manager). By background I mean that I cannot log 
into their Windows session, so for instance I cannot see their command line 
windows nor the moment when browsers' windows are instantiated.

When I launch Selenium node and hub manually, there is no such problem with 
creating Chrome browser instance.

Also, I do not have such problems with creating instances of Internet Explorer 
and FireFox, when Selenium node runs in background.

Steps to reproduce:

1. Schedule task with Windows Task Scheduler to launch Selenium Hub and Node 
just after Windows OS starts

2. Request creation of Selenium Web Driver.

      DesiredCapabilities capabilities = new DesiredCapabilities();
      capabilities.setCapability("chrome.switches", "--verbose");
      WebDriver driver = new RemoteWebDriver(hubUrl, DesiredCapabilities.chrome().merge(capabilities));

3. Expect driver instance to be created.

-----Other helpful tips:

* Chrome Version 38.0.2125.104 m
* chromedriver.exe Version 2.11
* Selenium Hub/Node in Java, Version 2.43.1

=========
node.log
=========

04:32:39.308 WARN [28] org.openqa.selenium.remote.server.DriverServlet - 
Exception thrown
org.openqa.selenium.WebDriverException: unknown error: cannot get automation 
extension
from timeout: Timed out receiving message from renderer: 600.000
  (Session info: chrome=38.0.2125.104)
  (Driver info: chromedriver=2.11.298604 (75ea2fdb5c87f133a8e1b8da16f6091fb7d5321e),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 600.29 seconds
Build info: version: '2.43.1', revision: '5163bce', time: '2014-09-10 16:27:33'
System info: host: 'KRK-WP00T', ip: '172.29.34.72', os.name: 'Windows 7', 
os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_55'
Session ID: 1fe494d25a10ba9a25d2a04ba0b3b119
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, 
browserName=chrome, 
chrome={userDataDir=C:\Users\test\AppData\Local\Temp\scoped_dir4404_25103}, 
rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, 
version=38.0.2125.104, takesHeapSnapshot=true, cssSelectorsEnabled=true, 
databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, 
nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, 
takesScreenshot=true}]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
    at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:829)
    at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWindow.maximize(EventFiringWebDriver.java:630)
    at org.openqa.selenium.remote.server.handler.MaximizeWindow.call(MaximizeWindow.java:30)
    at org.openqa.selenium.remote.server.handler.MaximizeWindow.call(MaximizeWindow.java:1)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:169)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
04:32:39.309 WARN [28] org.openqa.selenium.remote.server.DriverServlet - 
Exception: unknown error: cannot get automation extension
from timeout: Timed out receiving message from renderer: 600.000
  (Session info: chrome=38.0.2125.104)
  (Driver info: chromedriver=2.11.298604 (75ea2fdb5c87f133a8e1b8da16f6091fb7d5321e),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 600.29 seconds
Build info: version: '2.43.1', revision: '5163bce', time: '2014-09-10 16:27:33'
System info: host: 'KRK-WP00T', ip: '172.29.34.72', os.name: 'Windows 7', 
os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_55'
Session ID: 1fe494d25a10ba9a25d2a04ba0b3b119
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, 
browserName=chrome, 
chrome={userDataDir=C:\Users\test\AppData\Local\Temp\scoped_dir4404_25103}, 
rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, 
version=38.0.2125.104, takesHeapSnapshot=true, cssSelectorsEnabled=true, 
databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, 
nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, 
takesScreenshot=true}]

===========
Error in Java client
===========

org.openqa.selenium.WebDriverException: unknown error: cannot get automation 
extension
from timeout: Timed out receiving message from renderer: 600.000
  (Session info: chrome=38.0.2125.104)
  (Driver info: chromedriver=2.11.298604 (75ea2fdb5c87f133a8e1b8da16f6091fb7d5321e),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 600.28 seconds
Build info: version: '2.43.1', revision: '5163bce', time: '2014-09-10 16:27:33'
System info: host: 'KRK-WP00T', ip: '172.29.34.72', os.name: 'Windows 7', 
os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_55'
Session ID: 6385ce2e453cd107c5f310c485339754
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, 
browserName=chrome, 
chrome={userDataDir=C:\Users\test\AppData\Local\Temp\scoped_dir4284_29756}, 
rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, 
version=38.0.2125.104, takesHeapSnapshot=true, cssSelectorsEnabled=true, 
databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, 
nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, 
takesScreenshot=true}]
Command duration or timeout: 600.05 seconds
Build info: version: '2.43.0', revision: 
'accb3003b9fb8f7cae30f9669b4c594a065396a6', time: '2014-09-09 22:22:51'
System info: host: 'krk-mpfxv', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 
'x86_64', os.version: '10.9.4', java.version: '1.7.0_51'
Session ID: dbad6086-02ae-4c2e-bd25-d6e2ce772e60
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, 
browserName=chrome, 
chrome={userDataDir=C:\Users\test\AppData\Local\Temp\scoped_dir4284_29756}, 
rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, 
webdriver.remote.sessionid=dbad6086-02ae-4c2e-bd25-d6e2ce772e60, 
version=38.0.2125.104, takesHeapSnapshot=true, cssSelectorsEnabled=true, 
databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, 
nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, 
takesScreenshot=true}]
    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:204)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
    at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:829)
    at com.akamai.ap.apt.ui.setup.WebDriverFactory.createWebDriver(WebDriverFactory.java:59)
    at com.akamai.ap.apt.test.smoke.SeleniumHubTest.createWebDriver(SeleniumHubTest.java:54)
    at com.akamai.ap.apt.test.smoke.SeleniumHubTest.chromeShouldBeAvailable(SeleniumHubTest.java:44)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    at org.testng.TestRunner.privateRun(TestRunner.java:767)
    at org.testng.TestRunner.run(TestRunner.java:617)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
    at org.testng.TestNG.run(TestNG.java:1057)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
    at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:125)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: org.openqa.selenium.WebDriverException: unknown error: cannot get 
automation extension
from timeout: Timed out receiving message from renderer: 600.000
  (Session info: chrome=38.0.2125.104)
  (Driver info: chromedriver=2.11.298604 (75ea2fdb5c87f133a8e1b8da16f6091fb7d5321e),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 600.28 seconds
Build info: version: '2.43.1', revision: '5163bce', time: '2014-09-10 16:27:33'
System info: host: 'KRK-WP00T', ip: '172.29.34.72', os.name: 'Windows 7', 
os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_55'
Session ID: 6385ce2e453cd107c5f310c485339754
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, 
browserName=chrome, 
chrome={userDataDir=C:\Users\test\AppData\Local\Temp\scoped_dir4284_29756}, 
rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, 
version=38.0.2125.104, takesHeapSnapshot=true, cssSelectorsEnabled=true, 
databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, 
nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, 
takesScreenshot=true}]
Build info: version: '2.43.0', revision: 
'accb3003b9fb8f7cae30f9669b4c594a065396a6', time: '2014-09-09 22:22:51'
System info: host: 'krk-mpfxv', ip: '127.0.0.1', os.name: 'Mac OS X', os.arch: 
'x86_64', os.version: '10.9.4', java.version: '1.7.0_51'
Driver info: driver.version: RemoteWebDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
    at org.openqa.selenium.remote.RemoteWebDriver$RemoteWebDriverOptions$RemoteWindow.maximize(RemoteWebDriver.java:829)
    at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWindow.maximize(EventFiringWebDriver.java:630)
    at org.openqa.selenium.remote.server.handler.MaximizeWindow.call(MaximizeWindow.java:30)
    at org.openqa.selenium.remote.server.handler.MaximizeWindow.call(MaximizeWindow.java:1)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:169)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

Original issue reported on code.google.com by mgawine...@gmail.com on 20 Oct 2014 at 11:51

GoogleCodeExporter commented 9 years ago
Hello,
This issue has appeared on our environment as well since 15th October. It seems 
that the problem is related to the new Chrome version.

The issue is reproducible with the following chromedriver versions - 7 / 8 / 9 
/ 10 /11. I haven`t tried with the ones before 7.

I have tried with the latest Chrome Beta version (39....) and the issue is 
reproducible as well.

Selenium Hub / Nodes are setup as a windows service. The following guide was 
followed - 
http://brantleytec.blogspot.com/2012/11/selenium-hub-and-node-as-windows-service
.html. 

Workaround - stop the service / create autologin / add a bat script which will 
start the selenium node on startup.

Original comment by Stanoev....@gmail.com on 20 Oct 2014 at 4:44

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hello and thanks for your feedback.

I'm not running Selenium Hub / Nodes as a windows service, but as a task 
scheduled by Windows Task Scheduler with option "run whether user is logged in 
or not" checked up. I guess, still, the root cause is the same: in both cases 
it tries to run Chrome in non-interactive way. And it fails.

I cannot turn on autologin because in my Windows 7 Enterprise there is no such 
option for security reasons (the machine is on a domain): 
http://answers.microsoft.com/en-us/windows/forum/windows_7-security/windows-7-au
to-login-without-the-users-must-enter/d8a23f48-6333-4def-9d5c-8dae444f8093

The workaround I found is to register a task to be scheduled on user logon (not 
on system startup) and check up the "run when user is logged in" option. This 
is far from perfect because it requires an additional manual step (log in) each 
time a machine is restarted but it works.

Original comment by mgawine...@gmail.com on 21 Oct 2014 at 2:46

GoogleCodeExporter commented 9 years ago
Hello,

Today I got latest version of Chrome exe V 2.12 and Standalone server 2.44, and 
we started facing same issue. Everything works when we run Standalone Hub and 
Node manually but when we run them using task scheduler then nothing works.

Please update if someone found solution related to this issue.

Original comment by praveent...@gmail.com on 31 Oct 2014 at 11:00

GoogleCodeExporter commented 9 years ago
Hello, 
I am also facing the same issue, when I try to run my Selenium tests from the 
task scheduler. It works perfectly fine when I run them manually. Can any one 
suggest a older version of chrome that might work.. ?

Thanks,
Barkha

Original comment by mbar...@gmail.com on 31 Oct 2014 at 9:16

GoogleCodeExporter commented 9 years ago
Hi all,

I'm experiencing the exact same issues!

Successful:
- Executed Selenium node manually (node command process in foreground)
- Run parallel tests in Chrome
- All tests run without issues

Fail:
- Executed Selenium node remotely (node command process in BACKGROUND)
- Run parallel tests in Chrome
- Tests hang and then eventually fail
- HOWEVER
- This only happens when I try to run more than TWO tests in parallel
- If I run 1 or 2 tests in parallel, the tests execute without any issues
- If I so much as run 3 tests in parallel, the tests hang and fail...

Bit of a frustrating issue, this...
Any ideas or temporary workarounds?

Thanks,
Nathan

Original comment by tnfola...@gmail.com on 7 Jan 2015 at 6:30

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:18

GoogleCodeExporter commented 9 years ago
issue looks similar to 
https://code.google.com/p/chromium/issues/detail?id=422218#c39.
This issue is not reproducible with latest chrome version '41.0.2272.89'.

please try with latest version and let us know if we differ from what you are 
doing.

Original comment by ssudunag...@chromium.org on 12 Mar 2015 at 6:42

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by ssudunag...@chromium.org on 26 Mar 2015 at 6:30