开发者

Selenium RC doesn't save screenshot on VMWare

开发者 https://www.devze.com 2023-02-18 03:32 出处:网络
I am running a Selenium RC (selenium-server-standalone-2.0b2.jar) on a VMWare (Workstation 7.0.0 build-203739) Virtual Machine (Windows XP Professional SP3).

I am running a Selenium RC (selenium-server-standalone-2.0b2.jar) on a VMWare (Workstation 7.0.0 build-203739) Virtual Machine (Windows XP Professional SP3).

I run tests on this selenium server using Bromine. One of the tests contains a captureEntirePageScreenshot command to save a screenshot:

captureEntirePageScreenshot("c:/Temp/Screenshot.png", "")

This command is passed to Selenium server and it reports ok:

14:33:28.312 INFO - Command request: captureEntirePageScreenshot[C:/Temp/Screenshot.png, ] on session 1e301bb6dca4481ba007225fb4ef4f84
14:33:28.406 INFO - Got result: [base64 encoded PNG] on session 1e301bb6dca4481ba007225fb4ef4f84
14:33:30.937 INFO - Command request: testComplete[, ] on session 1e301bb6dca4481ba007225fb4ef4f84

But there is no screenshot in c:/Temp after this.

I have also tried captureEntirePageScreenshotToString() command, and it returns a string like this (instead of returning a base64-encoded png):

OR: java.io.FileNotFoundException: C:\DOCUME~1\Black\LOCALS~1\Temp\customProfileDir0be0044d90b44d63bcc746e8e6c79b10\screenshots\page-screenshot-0be0044d90b44d63bcc746e8e6c79b10.png (File not found)

I conclude that either Selenium or JRE that runs it (version 1.6.0_24) can't write the file to disk in order to produce the screenshot. Any he开发者_StackOverflow社区lp would be greatly appreciated! Thanks in advance.

The Virtual Machine running the Selenium server has no Firewall / Antivirus software that could prevent writing to disk, it's a clean Windows XP install.


I resolved this by calling SnagIt Com Server from my tests (they are written in PHP). Thus, I get the ability to take screenshots in any browser, and also capture the entire page by scrolling down. So far by problem is solved. Thanks to everyone who posted answers, anyway.


I have encountered this issue once. While upgrading my browser to FF4. This happens mostly due to firefox profile. If you are using a custom profile, delete the existing one and create a new one. If you are not using a custom profile, run the tests after creating one. That should resolve this issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消