Attach Screenshot in Systema exceptions

In my process I am asked that when a system exception is presented, a screenshot is attached to the notification email.

Could anyone explain how to have good control over this?
That is, how do I control that the correct screenshot is sent, as an attachment the screenshot in an email?
Thank you!

Hi,
How about the following?

Put TakeScreenshot and set variable at SavedFilePath property (Let’s say savedPath)

Set savedpath variable at Attachment collection as the following image

Please note that it may be good to use TryCatch in case that TakeScreenShot fails.

Regards,

1 Like

HI @alexis.mendoza.rpa ,

Ideally in your system exception catch block, use an assign activity to set screen shot file name like if the current date and time is 03/07/2024 00:00:00, SystemException_030724_000000.png. While taking screen shot you can supply this name as well as path to save it in a desired location.

Once the screen shot is taken in the activity which you are using to send the mail , Pass the Folder Path + Screenshot file name(with extension) in the attachments argument.

This would help you to send the screenshot taken and saved at the current time.

why to save it using date and time, this would make it easy to track when exactly the system exception occurred, whether there were any downtime at that particular time or duration etc…,

Hope this helps you.!

Happy Automation…!!

Thanks,
Gautham.

Hie @alexis.mendoza.rpa if you are working with REFramework so in the set transaction status there is system exception feed where you can add take screenshot activity and that variable you can pass into the Send SMTP or any mail activity sending Activity …