Selenium run as a Windows service to take screenshots on errors Selenium run as a Windows service to take screenshots on errors selenium selenium

Selenium run as a Windows service to take screenshots on errors


Looks like there's a completely different answer. The Windows service (managed by TanukiSoftware Java Service Wrapper) was started with wrapper.ntservice.interactive set to false. Setting it to true has helped. Eventually the screenshots contain real screen content.

Consult the wrapper.ntservice.interactive for details. The analysis of the wrapper code leads to [SERVICE_INTERACTIVE_PROCESS](http://msdn.microsoft.com/en-us/library/ms683502(VS.85).aspx) flag being set when starting the Windows service.


What browser are you running these tests in? If it's Firefox I'd recommend the captureEntirePageScreenshot to capture the entire canvas - not just what's in view (rather than the screen) and captureEntirePageScreenshotToString if you're working remotely and want to save the files locally.

Not sure if it will help with your issue, but as it uses an add-on to Firefox it might be worth a try.


Reading a little more on this, it could be something to do with your windows service needing extra security permissions. Going back to Windows NT 3.5/4 services had restricted access to the application desktop (required for screenshots) and I'd guess their security restrictions continue to this day.

This thread about services on the java.net forums may provide the clues you need to get it working.