Click activity sometimes throws an error


I’m struggling with one problem, I have robot which is taking tasks from table, the table has different filters to use, robot uses 2 of them.

And here is the problem, robot throws randomly errors: Click expand Stage: The UiElement is no longer valid.

Before robot click i’ve made “Do while” with checking if click element exists, robot has 30 sec to find element and then click it. Also added screenshot for debbuging and i’ve checked that while error is throwed, i see that in log element has been found but error is throwed - screenshot shows that element exists.

Does anybody have idea why element is no longer valid if it is visible and if i stop robot and verify element manualy and it is OK.

use click image activity instead of normal click…

Parvati Thalal

Can’t there are 2 others simmilar images but with different selector

can u share both images selector…

Parvati Thalal

Hi @rado - Print your Element Exists value to validate whether it says True or False. Also in click activity please check with “Simulate Click” try and see.


Hi, already did, boolean value: TRUE, screenshot shows element is visible, simulate click doesn’t work.

Both would be having same selector I think. Check that. If yes, then identify a unique value which differentiate both the selectors. Then use that and click.


1 Like

Why i would do that if i’ve cheked unique selector and it is available ?

Here is screen of the do while activity

Hey @rado,

I would rather suggest you to use the retry scope with image exist or element exist instead of do while and then give it a try.

Point to note about retry scope:
-Action should remain empty
-Condition should have the image exist or element exist to check the specified element.
-Once the condition in retry scope is satisfied then only it will proceed to the next step

After the retry scope use the click activity.

Thanks for advice, but this do while is doing exactly same thing you described.

Yes, I completely agree but uipath has already given the activity to serve the purpose then i do not think we should go with the alternative approach.The advantage of using retry scope is it offers you the functionality of retry count and retry interval which gives you more control.
Try it may be it can help
Retry Interval:00:00:05
Number of retries:4

use image exist or element exist inside the condition block with default timeout let say 50000.

and then use the click activity with before delay 5000 and timeout 50000.

Let me know if that works.

1 Like

I disagree with you retry scope is usefull but it is not good solution while debuging, anything what is in the retry scope and fail, uipath will return that whole retry scope have failed.

Do while can also have intervals and retries count, I work as RPA developer for more than 2 years and trust me, Do While/While from my point of view is better. But thanks for advance.

Still i don’t think this is the case

Hey Guys,

Do you have the same opinion for retry scope

@Palaniyappan @lakshman @Lahiru.Fernando

1 Like

This is going in wrong direction, this is not a voting forum man.

I think the issue is not with while or one using alternative activity named retry scope
I agree upon @rado statement that while performs the same as retry scope but as @amarasto said it has certain unique features that stands out from the while loop like
—it has the number of retries to perform but while loop will perform until the condition doesn’t satisfy
—it has a time lapse between its consecutive retries but while doesn’t have that

Alright coming to the point. Now the issue is with the click activity
Let’s do one thing as element exists shows that the element is there in the page, copy the same selector and pass it as a value for the selector property in highlight activity and place this highlight activity next to this while loop…
Followed by that use a click activity with the same selector of what is there in the element exists
(Copy the selector value from element exists and paste it Here in the selector property of both highlight and click activity)

Let’s check with which it’s finding the element and trying to click
Kindly correct if I m wrong
Cheers @rado

@Palaniyappan This is great idea, i’ll check it later this day. Thanks !

Cheers @rado