Problem when retry sequence

Hello!
In my process at now i use Retry Scope activity to retry sequence until error was occured.
In short: I extract text from the site, as long as it’s possible (until error was occured, i made it with use dynamic selectors).
But i have a problem. First, it is standart veriables of Retry Scope, like NumberOfRetries = 3 (i guess i can change it, but I don’t know how much text on the site will need to be extracted (each site = different values = different number of retry attempts). Second problem is a condition of Retry Scope, I have to look for a nonexistent element to iterate until an error in the sequence is reached. So, ok. It’s works.
But maybe someone solved a similar problem in another way?
Of course, I could expose a huge number of attempts, in the condition to do a search on a non-existent element and the problem is solved = full iteration of Get Text until the error is occured.
But maybe there is another way to loop the Sequence until the error is occured?
Thanks.

@Foertsch

but I don’t know how much text on the site will need to be extracted

such scenarios can be covered e.g. with data scrapping, find children or other analysis implementations to find out the current situation

But maybe someone solved a similar problem in another way?

We do like retry scope but using it more in direction to get a controlled way for synchronizing with the e.g. application response. For getting the present situation we do analysis steps before (as described above). Does mean. we don’t try X times till error - we try to capture the information before that we do know if we have to try, catch, retrieve, wait…

But lets shift to be more specific. can you post some screenshots or share details on your scenario?

@ppr
Hello!
My main task is to loop the GetText activity, in the selector of which the expression:
“”
idx plays a key role here, because the text follows each other with the rotation of the selector, that is: text #1 selector idx=2, text # 2 selector idx=4 and so on.
I just need to loop this expression until then, while the robot will not fall into error. This way I get the names I need.
Find Children activity I haven’t used yet. I’ll try, maybe I can extract the data I need.
This is my main task. If I can do it, it will help me a lot in the future. I don’t see any alternative solutions yet, but what You’ve suggested is definitely worth a try - find elements with Find Children, output variable count use in Retry Scope, in option NumberOfRetries.

@Foertsch
can you edit your last post and using the grafik editor function to provide the selector details. Thanks

Instead of retry scope we can use Do While loop
like in the beginning use the activities to fetch the value we want and at last inside the while loop use ELEMENT EXISTS activity and get the output with a variable of type boolean named bool_exists
so in the do while loop mention the condition as bool_exists = True
so that it will run till the element doesnt exists

–and if we want to handle any exception while process executes we can keep this do while loop inside the TRY block of TRY CATCH activity so that if an error occurs it will go to CATCH BLOCK

hope thsi would help you
Cheers @Foertsch

Hello all, thanks for help.
@Palaniyappan
Can i ask, how to add IEnumerable(UiElement) to collection of IEnumebrale(UiElement)? I use acitivy Find Element for my task, but since I have a lot of UiElements, I would like to create a collection and add them there to use later in the “Click” activity. It’s possible?
Thanks.

OK, I figured it.
Initialize new list (i use Assign activity, colElements = New List(of UiElement)), then, drop Find Element activity, in Output - FoundElement - create new veriable or type existing. Now, drop Add to Collection activity, in the Misc - TypeArgument - select UiPath.Core.UiElement, then create new veriable in Collection, and type output veriable from Find Element - FoundElement in Item.
I hope I explained clearly. :slight_smile:
Thanks.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.