Problems with screenshots

953 views
Skip to first unread message

Pavel Stashevsky

unread,
Nov 4, 2009, 3:43:59 AM11/4/09
to webdriver
Why, when ScreenshotException throws and I do a screenshot, the
picture turns black?

Pavel Stashevsky

unread,
Nov 4, 2009, 4:57:50 AM11/4/09
to webdriver
It happens, when I do a screenshot of remote server.

Stacktrace

org.openqa.selenium.NoSuchElementException: Unable to locate element:
{"method":"id","selector":"allServiceIdsForAdd"}
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.24-8-
pve', java.version: '1.6.0_16'
Driver info: driver.version: firefox
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.28-15-
generic', java.version: '1.6.0_16'
Driver info: driver.version: firefox
at sun.reflect.GeneratedConstructorAccessor20.newInstance(Unknown
Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.openqa.selenium.firefox.Response.ifNecessaryThrow
(Response.java:105)
at org.openqa.selenium.firefox.FirefoxDriver.sendMessage
(FirefoxDriver.java:296)
at org.openqa.selenium.firefox.FirefoxDriver.sendMessage
(FirefoxDriver.java:290)
at org.openqa.selenium.firefox.FirefoxDriver.findElement
(FirefoxDriver.java:249)
at org.openqa.selenium.firefox.FirefoxDriver.findElementById
(FirefoxDriver.java:177)
at org.openqa.selenium.By$1.findElement(By.java:65)
at org.openqa.selenium.firefox.FirefoxDriver.findElement
(FirefoxDriver.java:173)
at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.openqa.selenium.support.events.EventFiringWebDriver$2.invoke
(EventFiringWebDriver.java:74)
at $Proxy1.findElement(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver.findElement
(EventFiringWebDriver.java:156)
at org.openqa.selenium.remote.server.handler.FindElement.call
(FindElement.java:48)
at org.openqa.selenium.remote.server.handler.FindElement.call
(FindElement.java:30)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.openqa.selenium.remote.ScreenshotException: Screen shot
has been taken
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.28-15-
generic', java.version: '1.6.0_16'
Driver info: driver.version: remote
at org.openqa.selenium.remote.RemoteWebDriver.throwIfResponseFailed
(RemoteWebDriver.java:440)
at org.openqa.selenium.remote.RemoteWebDriver.execute
(RemoteWebDriver.java:378)
at org.openqa.selenium.remote.RemoteWebDriver.findElementById
(RemoteWebDriver.java:127)
at org.openqa.selenium.By$1.findElement(By.java:65)
at org.openqa.selenium.remote.RemoteWebDriver.findElement
(RemoteWebDriver.java:122)
at ru.sibirenergo.billing.modules.Cashier.findByPhone(Cashier.java:
135)
at
ru.sibirenergo.billing.uucn.UUCNPaymentTest.testUUCNMakePaymentByPhone
(UUCNPaymentTest.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:
607)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
at org.testng.internal.TestMethodWorker.invokeTestMethods
(TestMethodWorker.java:126)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:
110)
at org.testng.TestRunner.runWorkers(TestRunner.java:759)
at org.testng.TestRunner.privateRun(TestRunner.java:592)
at org.testng.TestRunner.run(TestRunner.java:486)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
at org.testng.SuiteRunner.run(SuiteRunner.java:204)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
at org.testng.TestNG.run(TestNG.java:751)
at org.apache.maven.surefire.testng.TestNGExecutor.run
(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute
(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess
(SurefireBooter.java:338)
at org.apache.maven.surefire.booter.SurefireBooter.main
(SurefireBooter.java:997)
Caused by: org.openqa.selenium.remote.ScreenshotException: Screen shot
has been taken
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.28-15-
generic', java.version: '1.6.0_16'
Driver info: driver.version: remote
at org.openqa.selenium.remote.RemoteWebDriver.throwIfResponseFailed
(RemoteWebDriver.java:440)
at org.openqa.selenium.remote.RemoteWebDriver.execute
(RemoteWebDriver.java:378)
at org.openqa.selenium.remote.RemoteWebDriver.findElementById
(RemoteWebDriver.java:127)
at org.openqa.selenium.By$1.findElement(By.java:65)
at org.openqa.selenium.remote.RemoteWebDriver.findElement
(RemoteWebDriver.java:122)
at ru.sibirenergo.billing.modules.Cashier.findByPhone(Cashier.java:
135)
at
ru.sibirenergo.billing.uucn.UUCNPaymentTest.testUUCNMakePaymentByPhone
(UUCNPaymentTest.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:
607)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
at org.testng.internal.TestMethodWorker.invokeTestMethods
(TestMethodWorker.java:126)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:
110)
at org.testng.TestRunner.runWorkers(TestRunner.java:759)
at org.testng.TestRunner.privateRun(TestRunner.java:592)
at org.testng.TestRunner.run(TestRunner.java:486)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
at org.testng.SuiteRunner.run(SuiteRunner.java:204)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
at org.testng.TestNG.run(TestNG.java:751)
at org.apache.maven.surefire.testng.TestNGExecutor.run
(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute
(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess
(SurefireBooter.java:338)
at org.apache.maven.surefire.booter.SurefireBooter.main
(SurefireBooter.java:997)

Daniel Wagner-Hall

unread,
Nov 4, 2009, 8:58:24 AM11/4/09
to webd...@googlegroups.com
Does the whole screenshot turn black, or do you get elements and
things on top of a black canvas?

Pavel Stashevsky

unread,
Nov 4, 2009, 9:30:52 PM11/4/09
to webdriver
I get a completely black screenshot, sometimes there is a gray stripe
in the top.

Simon Stewart

unread,
Nov 5, 2009, 9:06:07 AM11/5/09
to webd...@googlegroups.com
I've seen this before: it looks like a problem with the AWT Robot, but
I've never managed to find out _what_ the problem is. Common solutions
have been to turn off the screen saver and to ensure that the server
process can use the desktop (eg: if you're on Windows that you're not
running as a service)

Regards,

Simon

Vlad Alyukov

unread,
Nov 5, 2009, 9:37:02 AM11/5/09
to webd...@googlegroups.com
Hi, Simon

I have the same problem on my browser farm on linux (i use headless configuration, w/o screen saver and any x-wm)

====[simple.sh]====
#!/bin/sh
# run virtual x server screen
/usr/bin/Xvfb :0 -screen 0 1024x768x24&
# export DISPLAY envirement 
export DISPLAY=:0&
# run webdriver server
java -Xms32m -Xmx64m -jar ~/webdriver-server.jar&
====[simple.sh]====


--
WBR,
Vlad Alyukov
+7.913.3718.666


Simon Stewart

unread,
Nov 5, 2009, 9:40:55 AM11/5/09
to webd...@googlegroups.com
Well at least it's cross-platform crazy. I'm still having trouble
replicating the issue.

Simon

Eran M.

unread,
Nov 5, 2009, 10:48:34 AM11/5/09
to webd...@googlegroups.com
Hi Vlad,

Can you take a screenshot manually?
e.g.:
xwd -display :0.0 -out /tmp/screendump

Eran

2009/11/5 Vlad Alyukov <valy...@gmail.com>
Reply all
Reply to author
Forward
0 new messages