Screen shot with email

Hi,

How can I take the screen shots in all the exceptions with date and time in the code and save in a particular location.
finally it will send a mail to concern people. Please help me the scenarios ?

Thanks.

@ssirigann sreedhar, use try catch block for your script. as and when your bot stops immediately try catch block will start executing 2nd part of try-catch block.

inside 2nd part of try-catch block, use send outlook mail message activity and create body with screenshot link.so that screen shot will be included in the mail message body and you will get an email with screenshot.
for screenshot, please use screenshot activity.
image also make sure you are giving desktop as a default screenshot area so that it will capture everything including error and don’t make it highlight.

This is how can we make bot more interactive and it will communicate with respective stake holders when it need attention… :wink:
hope my inputs are useful

3 Likes

Thanks Krishna this is helpful information, I will let you know once it is implemented .

Hi Krishna,
Is there any other scenarios like take screen shot and save in a folder and notification will sent via email using take screen shot and save image.

Thanks

Basically, screen shot will explain where bot got stuck… so it is not advisable to save it into a folder.
of course, you can save in a local path location but it is not advisable. When you start collecting all these screenshots and saving them into local folders then bot will create un necessary garbage. so the general design will be as follows:

  1. take screenshot.
  2. save in default location (common to every PC like temp etc… ) folder and collect screenshot name with full file path.
  3. paste/ attach same link in the email body so that screenshot will be circulated by email.
  4. delete the screenshot saved in the default location.

that’s end the work flow.
in some cases. we can create a email body template and use that template as a body of email and every time you will get nice information in the email.

it’s all depends on your ability to think and design what you need to delight your client.

Hope my inputs are useful.

1 Like

Thank you so much Krishna

I like this approach, could you explain more in detail how it will be executed?

  1. take screenshot.
    You have screenshot activities in UiPath.
  2. save in default location (common to every PC like temp etc… ) folder and collect screenshot name with full file path.
    You can save screenshot in your local machine… you have save options too…
  3. paste/ attach same link in the email body so that screenshot will be circulated by email.
    Collect path of screenshot in a variable as a string and and keep the same string in email body string variable.
  4. delete the screenshot saved in the default location.
    use file delete activity and pass this screenshot path string variable.

That’s it!

Could you help me out with this error ?=

1 Like

image file name must append as follows:
strImageFilename+“.png”
or
strImageFilename+“.jpg”

then it will work

2 Likes

For some reason it dont saves the image inside my folder but outside in documents

The folder path its put in a string like this \fs01\profiler\alan.langsem\Documents\ScreenShots RPA

looks like it is a remote drive… so i recommend to save in your local folder.
image

Managed to save in correct folder, but it wont send the file on email send

use screenshot file path variable in send email attachment. It will work

Currently i am taking the screenshot and then i am assiging a variable of type Image named Failuresc:

I am then in save image function setting image property to Failuresc, then i have another variable with my folderpath assigned as imagesavedpath, then in filename input field i am doing Imagesavedpath + “NameofFile.png”

In email i am assigned in attach files the imageSavedpath + "*.pngsaved "

just put this in your email attachment.

ImageSavePath+“DBSFAILURE.png” → in your email attachment.

1 Like

Yes it worked, so next step would be to check if the screenshot folder its empty or not, if empty then nothing if it contains images then delete them

Please mark as solved if you are good with my inputs…!

1 Like

would like to but its alrdy solved so cant check off anyting

hi
i need ur heip, on send outlook mail with Screenshot .but i dont want in attachment …i need to paste the screenshot in mail tried with JPG and PNG image but images are not displayed…can you help on this