Get Informative ScreenShot

Greetings,

Did anyone succeeded in getting Informative screenshot of the activity from the exception information.

Idea:
If robot fails to find a selector/enter a data into a field an exception is thrown which is catched either by GlobalHandler or TryCatch.

Here we can send an email to a customer about exception and further steps to take. Yet, as this is unknown exception not yet handled, we can not give specifics to the customer. And information with a generic “Click - Document” activity name does not gives enough information for the end user it would be extremely usefull to not only get the activity name, but also activity informative screenshot.

This would allow user to understand what exactly robot was doing before getting an exception.

Error info has Activity ID as well as Activity Instance, but I was unable to find a solution how to link these to the informative screenshot.

Sounds like you are looking for

Not really. Imagine we have interface with 500 elements and robot fails to find a selector for 1 in any of 30 steps robot is programmed to perform in the said screen.

When catches, robot will send a generic email to a customer “Sorry, I have failed to perform a task because of unknown error, here’s the exception message”

Now user has to deduce which of 500 elements robot was trying to interreact with.

If we can instead just say - “I have failed in THIS activity and here’s an informative screenshot” - end used would know exactly what was robot intended to do without developer’s interaction.

When any unexpected Exceptions occurs we can also model the screenshot taking (without modelling it 500 times redundandly)

Have a look at how it is done within the REF

Hey @eQueX

In Try Catch Activity
Use “Take Screenshot” Activity In Finally Block.
To send email use exception.message for real time exception tracking.
You can also use it in catch block based on your requirements.
PFA SS.

image

Thanks
Hammad Rafiq Tukdi :slight_smile:

When the idea is about:

  • get calculated / Tracked which activity is failed
  • grab the attached informative screenshot linked to the activity

it would use the XAML attribute e.g. InformativeScreenshot value
grafik

and grab it from the .Screenshots folder

Implementing such a logic can result in an increased complexity (depending on details and versions of UiPath Studio / packages)

A generic screenshot will display the situation about the interface. It will not give user the information about which button robot was trying to interact with

And so, after email with a generic screenshot, end user will email a developer about “what’s the problem here” and developer should investigate into code to look which element failed.

We can not take a screenshot of the element as… well… the selection already failed and so we can not target it by a selector.

In UiPath Studio we have these informative screenshots which allows us - as a developers to easier understand the code base of the robot.

What I am asking is if we could use the same screenshots as a base to inform a user as well.
image

Please Try These

  1. Exception.Message.ToString
  2. Exception.Source.ToString
  3. Exception.InnerException.Message.ToString

This is a stage I am currently in - reading XAML.

Yet the problem is understanding WHAT to read as in error info the only information is ActivityID/ActivityInstance and I am yet to find a link between ActivityID and XAML

Activity Name is not a reliable link.

These does not give the information I am looking for.

The focus is on the end user, who has 0 DEV experience and how to display the relevant information for him. No exception message or source is simple enough for the end user to understand.

Screenshot is - this is why we are trying to find the ability to display it.

Yes Same Scenerio I have Developed In My Company As Well, Thats why i am telling you to place “Take ScreenShot” Activity inside “Finally Block/Catch Block” it will send Informative SS of any exception where the bot stays and stucks.
In If condition you can also check if message.exeception contains “click” then login button not found can be send in email body ( just giving you example )

Exactly and also

why we mentioned

also with the hint:

Would we are forced to imlement it we could think about using some markers on the Activity Display Name, which helps us later for the XAML Identification and parsing in order to calculate the Activity and its linked screenshot

Imagine robot stucks on posting a comment in this forum.

According to Your solution I would inform user “We have experienced unknown exception in this app, please react accordingly”

Now user is left to understand what was robot trying to do. Maybe he was trying to press reply? Which one? On Your post or the bottom one? Or maybe robot was trying to press [Solution] As user is not sure what was robot trying to do - he needs help from developer.

The solution I am looking for is
Robot failed to press the button and send the same email just with additional text "the activity with exception name: Click: Reply
Activity Screenhot:
image

And this screenshot could be provided because in my code this activity looks like
image

Error.message will give you message and error.source will give activity name,
in your scenerio You will have to customzied your workflow with the conditions ( depends on your number of activties ) For example : if bot stucks on reply button , your bot will go in catch block and throw error for reply button , you have to check if log message contains “reply” keyword then in “THEN” block you will "send your customize message to your non tehcnical end user like : bot unable to click on reply button. similary you will have to customzie this for some scenerios.
As my borther @ppr Said, Implementing such a logic can result in an increased complexity, he is right but since your end user needs only non technical reasons i think this is very easy solution.

This solution require to manually updating each and every activity and not viable for a big automations.

This is why I am looking for a global solution, as mentioned preferably via GlobalHandler, where we have ActivityID but with this information we could not find a link to the activity itself.

It this link would exist - we could implement this logic once and it would work for all activities across all workflows in the same process.

as mentioned above, that your selected approach will risk of

But:

Will not mandatory need manual updating, as we can use techniques for mass replaces / updating

However also have a closer look on the global handler as it give us more details and maybe we can use for the activity identification as well

There is already global solution which i told above , Get Informative ScreenShot - #8 by hammad_rafiq but you requirement is different so i gave you that soution, well best of luck.