Here I am trying to take a screenshot and save it as a variable SCREENSHOT and attach it in SMTP mail attachment by adding “.tostring” {so the error is gone from the attachment box) is it the right way?
Now when it comes to e=sending the mail it throws an error “Send SMTP Mail Message: Object reference not set to an instance of an object.”
Does it mean the variable is null?
How shall I check whether the screenshot is taken and saved in a variable?
You have to use Take Screenshot into an image variable, then use Save Image to save that image variable to a file, then use the file path in the Send SMTP Mail Message activity to attach it.
File is where you put the variable that comes out of Take Screenshot. File name is where you put the path and filename where you want to save the image.
Take Screenshot:
Use the “Take Screenshot” activity to capture the current screen. This activity will produce an image, and you can store it in a variable of type Image.
Save Screenshot to File:
Use the “Save Image” activity to save the captured screenshot as a file. Provide the image variable from the “Take Screenshot” activity as input to the “Save Image” activity. Also, specify the file path where you want to save the screenshot, combining a folder path, a desired filename, and the file extension (e.g., “.png”).
Send Outlook Email:
In the “Attach File” property of the “Send Outlook Mail” activity, provide the same file path you used in the “Save Image” activity. This ensures that the screenshot file is attached to the email.
Hi @Anirudh_Tugawe ,
I have created one video and publish in youtube, Please try to watch still facing any issue will go for a call via zoom.
Vidoe Link:- https://youtu.be/p0gH0TbPCjs #techystack
Regards,
Pavan Kumar
Well now your problem is the selector for Take Screenshot is not correct. Do you need a screenshot of a specific element on the screen, or just the entire screen? If the entire screen is what you want, then use the classic Take Screenshot with no selector.