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
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.
@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
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.