captureScreenshot java.lang.NullPointerException

43 views
Skip to first unread message

testbcn

unread,
Apr 30, 2008, 6:39:35 AM4/30/08
to selenium-users...@googlegroups.com

How does it work?





12:30:38.343 INFO - Command request: captureScreenshot[C:/TESTS/SCREENSHOT.png,
] on session 144e7e3c32df4c348ed399522d99116f
12:30:38.343 INFO - Creating Robot
12:30:38.406 ERROR - Problem capturing screenshot
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.openqa.selenium.server.RobotRetriever.getRobot(RobotRetriever.jav
a:22)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.captureScree
nshot(SeleniumDriverResourceHandler.java:598)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(Se
leniumDriverResourceHandler.java:436)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleComman
dRequest(SeleniumDriverResourceHandler.java:388)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(Selen
iumDriverResourceHandler.java:135)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
Caused by: java.lang.NullPointerException
at sun.awt.FontConfiguration.getVersion(Unknown Source)
at sun.awt.FontConfiguration.readFontConfigFile(Unknown Source)
at sun.awt.FontConfiguration.<init>(Unknown Source)
at sun.awt.windows.WFontConfiguration.<init>(Unknown Source)
at sun.awt.Win32GraphicsEnvironment.createFontConfiguration(Unknown Sour
ce)
at sun.java2d.SunGraphicsEnvironment$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.java2d.SunGraphicsEnvironment.<init>(Unknown Source)
at sun.awt.Win32GraphicsEnvironment.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Unknown Sour
ce)
at java.awt.Robot.<init>(Unknown Source)
at org.openqa.selenium.server.RobotRetriever$Retriever.call(RobotRetriev
er.java:29)
at org.openqa.selenium.server.RobotRetriever$Retriever.call(RobotRetriev
er.java:26)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
12:30:38.406 INFO - Got result: ERROR: Problem capturing screenshot: java.lang.N
ullPointerException on session 144e7e3c32df4c348ed399522d99116f






hiran

unread,
Apr 30, 2008, 7:46:44 AM4/30/08
to selenium-users...@googlegroups.com

How did you trigger the captureScreenshot command? Did you place it inside the test script? How?


What is your environment? Does the computer running the tests have a desktop environment? Can you create a java application that instantiates Robot and makes a screenshot?



testbcn

unread,
Apr 30, 2008, 8:05:30 AM4/30/08
to selenium-users...@googlegroups.com

Windows XP Profesional, Selenium RC in C# and NUnit.


the latest version of selenium.


selenium.Open("/");
selenium.CaptureScreenshot("C:/TESTS/SCREENSHOT.png");






Reply all
Reply to author
Forward
0 new messages