Tools and methods to debug when a selector is not found

Hello,

a robot, connected to an Orchestrator instance and automating a SAP process, shows the classic “Cannot find the UI element corresponding to this selector” once in a while. It may be running OK for 1-2 weeks, then some day it fails.
It is clearly not a deterministic fault, otherwise it would fail every time it runs. The selector, needless to say, is validated each time we check it.
It is scheduled to run very early in the morning, so that it’s impossible for anyone to stay there looking at what it does. More funnily, the robot works perfectly if restarted in the morning, after having realized it failed. The selector is OK even when executed via Studio in debug mode.

We use a screen recorder, to be able to review what happened at a later time, but again, someone would have to start it in the middle of the night, to avoid recording 24x7 and producing tons of GB on the disk.
In these cases, we end up wondering what the heck happened last night, but of course that’s no good reason for our Client.
We added a lot of log messages, including a full stack of any exception is thrown, but that gives us no real insight into why that selector wasn’t found at that particular time.
So are there any other ways to investigate such an error ? Any other low-level information we might be extracting and printing in the first place ? Any verbose/debug flag explicitly for selectors ?
Thanks

I totally get your frustration. We all have faced this. Unfortunately, I don’t think there will be any information in UiPath logs that can explain why it was not able to find an element. For UiPath, the element is simply not there.

You could try these

  • Optimize the selector if you haven’t done it already.
  • Try to run the screen recorder using Windows Scheduler and see if you can find why it is failing.

Hi @prepetti ,

Perhaps the issue is not with the activity which throws the error do you see.
The issues might be triggered as well by your previous actions, which at a first look, it seems working fine.

Perhaps, some of your actions from the RPA process are impacted by the internet speed or, how fast your SAP is working at that time in the morning. Please see the big picture…

One fast workaround might be to use a workflow (instead of a sequence) and surround your whole RPA process with a big try/catch. If there is any kind of error, just go back and start again the process.

Best regards,
Marius

1 Like

Hi @Marius_Puscasu ,

surrounding the whole process with a general try/catch was one of the first things we did, and that’s what lets us know in real time that the robot has failed: the catch block gets source/line/stack info from the exception instance and sends it by email to a diagnostic mailbox.
I agree with all your other considerations about the big picture - and I thank you for them- , the speed, the fact that the flaw might be in some action before…virtual screen resolution is another headache we’re dealing with…the point seems to me that it is not enough. Eventually you have to figure out what happened at, say, 3:12AM, not when you repeat the execution watching it.
We are no RPA geniuses but we’ve developed a fair number of robots in 3 years, we’re not those beginners. I think we lack tools to help us understand a missed selector from an internal, UiPath activity point of sight. I wrote this post in the hope that some brainstorming would bring some suggestion.
Thanks.

1 Like

My 2 cents would be to use an older or newer version of the particular activity package and see if it will resolve the problem. Another solution would be to record the session with Windows Scheduler as KananSuresh mentioned earlier. If you are running tight on your disk space on your robot machine. You can stream the robot machine from your laptop/desktop and record the session so the file will be stored to your local hard drive.

@KannanSuresh scheduling the recorder is a very nice idea, we tried that with FlashBack Express. Unfortunately, we had to leave an RDP session open to allow the recorder to find a session to start within, and found out that might cause some other problems sometimes (sessions killed by security, wrong screen resolution, etc).
Thanks

Hi @prepetti ,

Have you tried using the Diagnostic Tool ?

Please check:

https://docs.uipath.com/studio/docs/diagnostic-tool

https://www.youtube.com/watch?v=UEu0bemS3KY&ab_channel=LahiruFernando

Best regards,
Marius

Thanks @Marius_Puscasu that looks very interesting. Is it compatible with all UiPath versions ? Our specific Client is lagging a bit behind with its Orchestrator and Studio (2018).

One more question: is the information gathered by the Tool browsable by the develoepr or is it just for Support ?

Thanks