I would like an automated web tests suite based on Selenium RC to take screenshots of pages when some errors are encountered. The test suite is a part of the continuous integration process and technically is executed by CruiseControl running as a **Windows service**.
The `selenium.captureScreenshot()` method is called to trigger the actual screenshot. I've registered a JUnit `RunListener` to call it on any test failure.
The problem is the screenshots are just **blank files** - PNG files totally black. The dimensions are 1440x900.
When manually running the same tests from Eclipse the screenshots are OK (althought they are screenshots of the whole desktop not the browser window, but that's a different story and a minor issue). So I guess the cause of the problem is the Selenium being run as a Windows service.
How can I have the screenshots of pages taken when exceptions in Selenium tests happen?
The software used:
- Windows 2003 Server
- Selenium 1.0.1
以上就是Selenium run as a Windows service to take screenshots on errors的详细内容，更多请关注web前端其它相关文章！