When using the Object Respository and an element can not be found (e.g. when a pop-up prevents the robot from going to the next screen), we get the following generic exception message.
Could not find the user-interface (UI) element for this action.
• Ensure application is opened and the UI element is visible on the screen at execution time
• Edit the Target of the UI activity and use Validation to debug the issue.
• If needed, re-indicate the element as its properties might have changed
• Use “Check state” activity to check the application state before executing the action
• Increase the “Delay before” value to allow time to the application to render entirely and become responsive
I was wondering if there is a way to make this exception message more specific, so we know which element was not found. Perhaps by including the activity title or Object Repository item name.
Another option would be to surround each activity with a try-catch and throw own exceptions, but this is not an ideal solution in my opinion.
Then I would suggest you to try with Global exception handler
That would focus on all the activities and there you got a property to know the activity name where it got failed
Use the ActivityInfo property for errorInfo to get the name of the activity which threw the exception and view it in the Output panel.
That Global Exception Handler looks useful, I used it before but did not know that this was one of the possibilities.
Is there a way to add that ActivityInfo to the Exception Message? Do we throw a custom exception from the Global Exception Handler and set result to ignore? Or what would be the correct way to do this?