views:

322

answers:

3

I have a scheduled task that runs a set of Selenium tests every night at 3:30am. These tests also take a screenshot if they fail and email that screenshot to the development team. The problem I'm having, however, is that the screenshots only work when I'm logged in to the virtual machine (Windows Server 2003) that runs the tests. If no one is logged in, the screenshots are black.

Is there a simple way to fix this?

Thanks!

-Mark

+1  A: 

It seems like this is question is related to another question (I noticed it over there >>> in the related question area):

http://stackoverflow.com/questions/1260106/selenium-run-as-a-windows-service-to-take-screenshots-on-errors

The accepted answer on that one was posted by GrzegorzOledzki.

If none of those work, could you write a batch script to log your account onto the machine, have it run the tests, then log your account out?

GIGGAS2
Thanks for the tip. The accepted answer won't work because I'm running this is a Scheduled Task instead of a Windows Service, but I'll see if I can find a similar setting for the Scheduled Task.
Mark Erdmann
I am not an expert in MS Windows. Thus not really sure what is the difference between a Scheduled Task and a Service, but I would suggest you to find the place in the system registry, where the scheduled tasks are stored and check for any flags there.
Grzegorz Oledzki
A: 

One thing that did work was using VisualCron instead of Scheduled Task. This solution isn't ideal, however, because a server license for VisualCron is $150+.

Mark Erdmann
A: 

Is it possible that you just need to run your scheduled task as the user you used to set it up? As in perhaps you are trying to save your screen caps to your "my documents" folder. If the scheduled task is not run as that user you'll have a permissions error when trying to write the image to disk. Or ideally you could set it to run as administrator which would solve all permission issues.

Agile Noob