How to add the take screenshot in the workflow if ay error or exception occurs

How to add the take screenshot in the workflow if ay error or exception occurs.

I have added try and catch by adding take screenshot modern activity in the catch. But if any error occurs, I’m getting the screenshot of UiPath screenshot instead off the screen where the error occurs

Hi @anjani_priya,

i think you are running in attended mode and dubug mode so once you got an exception its navigating to UiPath application. if you run unattanded mode this problem will not occure.

If you are running in attended mode run as normal mode so you will get the application screenshots.

Regards,
Arivu

1 Like

I have tried in unattended also but im getting the error of UiPath assistant.


This is my catch flow

If you are using any single application use indicate element for Take screenshot activity.

Regards,
Arivu

@anjani_priya You can refer TakeScreenshot.xaml of Re-Framework.

In case you are running process in attended mode or debugging it will take screenshot of window present in front.

No, not a single application.

Yeah, I have gone through with reframework but im unable to add that in my workflow

@anjani_priya,

Any error you are getting while adding the workflow?

How to add the take screenshot xaml (Integration) in current worflow

@anjani_priya ,
hey just copy the xaml takescreenshot xaml from re-framework
then go to current workflow
click on file explore then just paste the xaml
later on refresh the workflow once
after this


just give the folder location where you want save the file and give the file path

cheers!!

hello @anjani_priya

I think its because your workflow has activity with property of Simulate Click/ Type into
try without using simulates and let me know if it works.

Cheers!!!

Hi @anjani_priya

In the Catch block, use the “Take Screenshot” activity from the UI Automation package instead of the Modern activity, as it captures the actual screen. Set the screenshot output to a variable and then use the “Save Image” activity to save the screenshot to a file or log it. This ensures that you capture the screen where the error occurs, rather than the UiPath robot’s screen.

Found helpful, mark as a solution. Thanks

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.