You have to login in order to post a reply to this topic.

2 replies [Last post]
fester
fester's picture
User offline. Last seen 1 year 34 weeks ago. Offline
Joined: 05/20/2010
Posts: 1

Hi guys..

Is it possible to do automate something where if a any part of the script fails.. that it will take a screenshot and send you an email with the screen shot?

 

Many thanks

Stephen

 

Andrew
Andrew's picture
User offline. Last seen 1 year 25 weeks ago. Offline
Joined: 03/12/2010
Posts: 33
Re: Screenshot on error

Yes, I think that is possible (I haven't tested my solution so I don't know for sure).

I would start by creating an error log that records any time a WinAutomation job fails.  From the console, select Tools->Options->Error Handling, and check the box "Write Event to Text File".  Then type in the directory to save the text file to.

Next, create a job with two actions.  The first action is the "Take Screenshot" action in the "System" category; select Capture: "Entire Screen" and Save Screen Shot to: "File" (I'm not sure what format to use; look at the file produced to see what is best).  The second action is "Send Email" with the screenshot file attached.   Finally, set up a trigger for the job--right click on the job, select "Edit Triggers"->"Add New Trigger"->"File Monitor Trigger" and select the log file from the first step.

Hope this helps!

Andrew

D.M.Altizer
User offline. Last seen 1 year 11 weeks ago. Offline
Joined: 01/12/2010
Posts: 204
Re: Screenshot on error

 The above-mentioned solution will work absolutely perfect, but there is an alternative that you can use:

Instead of writing to a text file, you can use the "Run Another Job" option in the Error Handling tab of the Options window of WinAutomation console. This way, you will not have to directly involve any text files, and your screenshot job will be executed directly whenever an exception occurs. Furthermore, you can always override the error handling setup for a specific job (and for example execute a different job instead of the default that will not send a screenshot but will write to a log file) by going to the "Job Properties" of the specific job (right click on it -> Edit Job Properties in the console window) and select "Override Default Options" in the "Error Handling" tab. 

__________________

==Dedicated Automation Solutions==

__________________

==Dedicated Automation Solutions==