Missing Ui Elements in webpage

Case 1
I the Ui elements are keeps on changing in the webpage we can use Anchors to find the element and select an appropriate element, or i can use find element activity to find the elements provided in the webpage.
Case 2
I am trying to get some missing element in a web page and UI path unbales to find as the element is no more available in the page. Pls help me with an activity to handle this situation.

Thx in advance

1 Like


Let’s go one by one

If you find the element positions keeps on changing then it is always good to use ANCHOR BASE activity where in anchor side use FIND ELEMENT Activity and in right side of anchor base use a CLICK or TYPE INTO or any activity you want to perform

And for this

Try using RETRY SCOPE activity where in the Action block have the set of activities you want to perform in that web page
Where as in CONDITION block use a ELEMENT EXISTS activity and indicate a element that would appear once the page loads completely

In property panel of retry scope mention the number of retries as 100 and delay between retries with few seconds you want
so that it will retry for every mentioned time gap for 100 times and at point if that element appears once page loads completely then that retry with stop and starts performing the activities inside that ACTION Block

Cheers @koussighan25

Thx, found it useful.
This was asked to me in couple of interviews that if the elements does not exist in the webpage whether it will through an exception error or UiPath have some activities named Catch(Kind of) that helps to execute even when the element is not available in the page

Can u pls through some idea in this activity.

1 Like

thats Try/Catch , this can be applied to any activity , whenever any type of error in thrown by the activity inside try/catch the execution of workflow will not stop abruptly but it will execute the activity which is present in the catch part. You can choose different exceptions, like say a variable A=10 now if you try to divide A by 0 then you will get a exception of type “system.exception.DivideByZeroException” so you can set the result as 0 if you get this exception.
Let me know if you have any questions , or pl ignore if I misunderstood your question :sweat_smile:

Thx for the post,

But my question is different and try catch activity will not be the solution for this error.

Yeah that’s right

Usually in UiPath to handle exception we use three activity

Try catch
Retry scope
Throw and retry ow

If we use try catch and include all the activities that we feel might throw error can be placed inside the TRY block and if any excpetion occurs it will go to catch and continue further with the process
But the problem is it won’t retry the one that bot failed

As your scenario requires retry we need to try to an extend for some time until the element appears

That’s why we use RETRY SCOPE activity where the action block will get retired to the number of times we want until the condition inside the condition block is fulfilled

So try catch can be used if you want to avoid the termination of a workflow because of failure of an activity
Where if you want to retry to certain extent until that activity performs fine then use RETRY scope activity
Hope this clarifies

Cheers @koussighan25