UiElementExists takes a long time to execute

We have a script to process transactions in a 3rd party app. It works great. However, it takes too long to execute a transaction (~8 min)

What I have noticed, is that it takes a long time in those places that are using the UiElementExists Activity.

According to UiElementExists documentation, the default time to timeout is 30 seconds. If those 30 seconds are reached, the activity throws an error. So, does UiPath actually sit and wait for any given time lower than that timeout time to find that element or it does not wait at all?

I am including an image with the pattern that is used in several places of our script:

a) Enter a case number in a search box and then press F6 on the keyboard to search it
b) Delay 5 seconds to give time to the 3rd party app to load the case.
c, d, e) If a pop up with the message ‘Case Not Found’ shows up, throw error

Even though the delay is only 5 seconds, it takes longer than that to execute the logic. The UiElementExists does not have any extra parameters. We only have the selector of the element that we are trying to find.

So, my question is, how can we improve this? Maybe another pattern? Another activity?


Hello @llavieri
Instead of searching for ‘Case not found’ message box, is it possible for you to set element exist for ‘Case found’? Cause in normal processing most of cases will get found, but your bot still gonna wait for ‘Case not found’ for default time of 30 seconds, which will create unnecessary delay in processing.

Hello there,
Try Image exist. :slightly_smiling_face:
No success try these steps

Yes I guess. That could speed up this part of the logic. But, there are other places that I have to really wait for other random pop ups to show up.

I’m looking at where I use Element Exists and successfully. In this case, I’m wanting it to be instant cause the element should already be loaded and if it’s not then move on quickly.

I change TimeoutMS to 0 so it moves on quickly.

EDIT: and if you want to wait til it loads, I would recommend a Find Element that will show up in the time frame which then you can check if the Element Exists (instead of the Delay activity)


Yep. That’s what I ended doing. FindElement with ContinueOnError to true and TimeoutMS to 0. Thanks

1 Like