Hi,
I'm trying to use the selenium captureScreenshot method to get a screenshot at a particular part of a test run.
When selenium.captureScreenshot("c:\tmp\test.png") gets executed I get the error below:
com.thoughtworks.selenium.SeleniumException: ERROR: Problem capturing screenshot: null
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:73)
at com.thoughtworks.selenium.DefaultSelenium.captureScreenshot(DefaultSelenium.java:546)
at vsm.ReportActions.saveAliquots(ReportActions.java:173)
C:\Program Files\twist\workspace\VSM\scenarios\Report Released Tissue.scn:13
Any ideas?
Thanks
Comment
Hi James,
Generally, you get this error when the folder doesnt exist ("tmp" in your case). Try with some existing folder and let us know.
Thanks.
Hi Nivetha,
c:\tmp does exist I also tried \tmp but this didn't work either. I also tried just specifying selenium.captureScreenshot("test.png") and that did work, but isn't optimal as I want to put them in a separate directory.
It didn't work as "\" (backslash) is escape character in Java.You should use "\\" (two consecutive backslash) or "/" forward slash as your directory seperator. For example, you may specify as,
selenium.captureScreenshot("c:\\tmp\\test.png")
or
selenium.captureScreenshot("c:/tmp/test.png")
ok that's embarrassing. I'll try it out later. Thanks!
Hi i am using Twist to automate my application, i have a batch file which executes around 20 twist customer journeys it will take almost 1hour to execute all journeys, in the mean time i will be login to some other server and do some work in that server machine and come back again to my twist scenarios running server machine, because of that i will not get some scenarios screen shot properly(it will be dark), if i stay in the same twist running server machine without going to any server machine i will get screenshots properly so can you help me solve this problem?