Dynamic Delays with loading state

Hello Community

I´m facing a new challenge while working with a web page, sure someone else have had this problem.
Let me give some context… Im working with a webpage to input and extract data, while doing the actions sometimes the webpage throws a “loading state”, sometimes the loading can take around 10 seconds, but depending on the server or wi-fi connection it can take up to 3 minutes in loading like any typical web application.

I’m tackling this with “While loops” and “Check Apps State” but as always I’m very curious about how other developers with more experience would tackle this scenario.
How would you identify the loading state and how would you configure the bot so it doesn´t stop even if the loading takes more time the any other before?

Thank you for your attention… Regards

Hi @Luis_Fernando ,
I understand your problem
Normally with too long time, the activity will fail.
I think you can use element exits.
If the download is not complete, continue to wait.
but I think it is best to create the best environment because 3 minutes is too long.
It can allow under 30s
Regards,
LNV

1 Like

retry scope along with check app state

when loading state display is triggered via css (e.g. display)
we try to check any hints on class names … etc
or
can use the following for reading out CSS Property values:

1 Like

Hi @Luis_Fernando

These are some handling mechanisms and methods.

=> Identify Loading State:

Check for visual elements: Look for specific visual indicators like loading spinners, progress bars, loading messages, or any other UI elements that appear only during the loading state. You can use activities like “Element Exists” or “Image Exists” to check if these elements are present on the screen.
Check for changes in data or page content: If the loading state results in changes in data or page content, you can use activities like “Get Text” or “Get Full Text” to read specific elements or text from the page and check if it matches the loading state message.

=> Configure the Bot to Handle Longer Loading Times:

Use Timeout properties: Many activities in UiPath have built-in timeout properties that allow you to specify the maximum time the bot should wait for an action to complete. For example, if you are waiting for an element to appear, you can set a suitable timeout for the “Element Exists” activity. This prevents the bot from waiting indefinitely and helps in handling situations when the loading takes more time than expected.
Implement retries: You can use the Retry Scope activity to retry certain actions a specific number of times in case of failures or when the loading takes longer than usual. This way, the bot can make multiple attempts to check if the loading state has finished and proceed accordingly.
Use dynamic waiting: Instead of using fixed delays, consider using dynamic waiting mechanisms like “Element Vanish” or “Wait Element Vanish” activities, which wait until a specific element disappears from the screen. This is helpful when you don’t know the exact loading time but want the bot to continue as soon as the loading state disappears.

Hope it helps!!

1 Like

You are supposed to use the Timeouts to handle this. Set the activity timeout to longer than you expect it ever to take for the page to load.

@Luis_Fernando

You dont need while loop i beleive…you only need to increase the timeout on check app state activity

Cheers

Hello Dear friends, @postwick @Anil_G, The reason that higher timeout wasn´t exactly the correct solution for my case it´s mainly because the bot started running activities before the loading state was really finished, so there were moments where even the error was thrown though the timeout was higher. The other reason is that I much rather develop a workflow able to understand the loading state and in that way maybe improve performance and logging.

Thank you very much for your responses, thanks to you I get to scale my level and try harder on thinking solutions and what really fits for it.

Regards

@Luis_Fernando

Did you use wait for load complete?

cheers

Hello @Luong_Nguyen1, I finally did something similar to your suggestion, instead of a “Element Exists” I used a “Check App State” and it´s working good. Only thing I´m scared of is that if the loading state takes for ever the bot will stay for ever too, making an infinite loop. Sure I can go around it

Thank you for your attention

Hello @ppr. I gotta say this seems veery interesting and even though I went into a different solution, I will take this and put it into y tool box.
Thank you very much for your attention.

Hello @mkankatala, Definitely this was the most useful feedback, you gave summarize all my options, and finally did something with it.

Thank you very much for your feedback.

Thank you @Luis_Fernando

Happy Automation!!

1 Like

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