Dynamic Wait in UiPath


#1

hi Team,

Presently working on IE with Uipath, where we need to login into a application and before logging in a legal agreement must be accepted at that point of time system has to wait till the Legal agreement page is loaded and click on the button, tried working with Delay with fixed time, works fine. But when the loading time is going more than the time mentioned its is throwing the error as Button not found.

So for this i need a dynamic wait so tried working with Find Image and Retry Scope but the results are not that perfect is not stable also.

Can anyone suggest me a better way to use the dynamic wait.
Any suggestion will be helpful
Thanks in advance


#2

Hi @harsha8687,
You can use Element exists activity and use whileto loop through it, if the element exists false give some fixed delay and check until the element exist is true. If the element exists is true then break the loop and continue with the flow. Hope this helps.

Thanks .


#3

hi @Uthraa ,

Thanks for your fast response, can i have a code sampleā€¦


#4

Hello,

You can increase your TimeoutMS value of your click activity, its default value is 3000.
It will look for UI element within this time it it does find it then will go ahead. otherwise will stop with exception.

Cheers,
Pankaj


#5

hi,

What your telling is correct but in that way we cant handle that exception so in that situation. I want by bot to wait for a while and try to click the button again.

Thanks


#6

Hello,

Below link may be useful to you,

Cheers,
Pankaj


#7

Hi @harsha8687

It mostly depends on the way you can verify that the page is fully loaded.
Can you clearly state what is the condition here.

From what you have said, I think you need to use a simple Find Element activity with a selector that points to your button. UiPath will pause and wait for the button to appear :slight_smile:


#8

Hi,
You can even use Retry Scope activity and refer the code for this test (2).xaml (7.8 KB)
Thanks.


#9

Hi @harsha8687 it would be best to use do while loop as i had to face the similar situation in my project. I used do while as an alternative to delay. Main.xaml (5.0 KB)