Reputation: 1329
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
Upvotes: 2
Views: 3052
Reputation: 2335
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.
Upvotes: 0
Reputation: 1329
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+.
Upvotes: 3
Reputation: 101
It seems like this is question is related to another question (I noticed it over there >>> in the related question area):
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?
Upvotes: 1