Problem taking pictures using a RemoteWebDriver through Selenium grid.

60 views
Skip to first unread message

James Graham

unread,
Jun 24, 2016, 3:33:02 PM6/24/16
to Selenium Users
So here's my situation. My code is in Java. I'm running tests on Jenkins and pointing to a hub using Selenium Grid which redirects to a Mac mini. I get a random bug that causes a browser time out when taking screenshots and it means that every screenshot ends up taking between 10 and 30 minutes and never actually takes it. This does not happen every time, but it does happen MOST times. It will go away for a day then suddenly come back. Here's my stack trace.

org.openqa.selenium.TimeoutException: timeout: Timed out receiving message from renderer: 600.000
  (Session info: chrome=51.0.2704.103)
  (Driver info: chromedriver=2.22.397929 (fb72fb249a903a0b1041ea71eb4c8b3fa0d9be5a),platform=Mac OS X 10.10.5 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1800.00 seconds
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'GL-6G1HW-MM1', ip: '153.7.132.65', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.5', java.version: '1.8.0_60'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, chrome={chromedriverVersion=2.22.397929 (fb72fb249a903a0b1041ea71eb4c8b3fa0d9be5a), userDataDir=./web-acceptance-tests/src/test/resources/com/disney/assets/ChromeSettingsAndExtensions}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=51.0.2704.103, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 192e9bf6c81331ca7af48bbaaa5d351e
Command duration or timeout: 1800.12 seconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'build-jenkins01', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-573.18.1.el6.x86_64', java.version: '1.8.0_60'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, chrome={chromedriverVersion=2.22.397929 (fb72fb249a903a0b1041ea71eb4c8b3fa0d9be5a), userDataDir=./web-acceptance-tests/src/test/resources/com/disney/assets/ChromeSettingsAndExtensions}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=51.0.2704.103, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, webdriver.remote.sessionid=403aab7b-cdcb-45bb-8def-9ccf63812c85, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 403aab7b-cdcb-45bb-8def-9ccf63812c85
	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.execute(RemoteWebDriver.java:701)
	at org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs(RemoteWebDriver.java:335)

Here's the setup that it's running on:

OS=Yosemite
chromedriverVersion=2.22.397929
Selenium=2.53.0
Selenium grid=2.47.1

Here's the code I've attempted to use to take a screenshot. Happens in all cases.

1.
byte[] srcFile = ((RemoteWebDriver)driver).getScreenshotAs(OutputType.BYTES);
2. WebDriver augmentedDriver = new AutomationAugmenter().augment(driver);
File srcFile = ((TakesScreenshot)augmentedDriver).getScreenshotAs(OutputType.FILE);

3.
File srcFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);

4.
WebDriver augmentedDriver = new JdkAugmenter().augment(driver);
File srcFile = ((TakesScreenshot)augmentedDriver).getScreenshotAs(OutputType.FILE);


Please help!

James Graham

unread,
Jul 1, 2016, 12:43:39 PM7/1/16
to Selenium Users
Just wanted to post that we figured out what was happening and reporting it in case anyone else ever comes across the same issue. Turns out that the remote computer had a screen saver turned on that would sometimes turn on during testing. When this happened Chromedriver was unable to take screenshots. Thanks all.
Reply all
Reply to author
Forward
0 new messages