Best Pattern for Intermittent Slow Results?

I’ve got a bot that is doing multiple searches on a web app. When I run it in production it usually is quite fast but the dev environment often starts the day extremely sluggish then gets faster as the day goes along. (Perhaps it is building cache? Who knows?)

I’m looking for a pattern that will handle a slow search result but also will recognize when the results come back faster.

I’ve tried using the Timeout and setting it to 60 seconds. This catches nearly every search case. I also set the “wait for ready” to complete thinking that maybe the “GetValue” would kindly wait for the search spinner to stop before attempting to get the text.

Some comments on both. “Timeout” doesn’t seem to mean what I thought it would mean. If I set the bot to timeout at 60 seconds, then no matter how quickly the results come back from search it still takes 60 seconds for each run. (see attached logs)

I think what I’d really like is something like an internal loop in the workflow so that it could keep checking to see if the results loaded, try again for a period of time, and ultimately either flow out to a success/fail path.

Any suggestions? Obviously making the timeout set for the maximum plausible failure ruins performance.

My temporary workaround is to lower the timeout and skip a row that is taking too long to load, but that’s not ideal.

1 Like

please let me know If i misunderstood your question:
Q) you are extracting some data from browser/application , in which there is some kind of loading symbol showing up , after the loading symbol completes you get your data/file/download?

If so , try to use a retry scope, inside which use the get attribute activity and check for “visibility” of the loading symbol this will give you a int type output if its 0 that means the loading symbol is visible on screen and if its 1 then loading symbol is not present

in the condition part of retry scope put a “Check True” activity and check if the value of the variable is 1 or not
in retry scope settings set number of retry to some 100-200 and duration as 5sec or something else , so this will keep checking if loading is there or not , once it gets removed it will move forward in code , so the delay that you were using will become dynamic
Hope this helps :slight_smile:

The only loading indicator is the spinner in the tab, not an onscreen modal - but I haven’t tried the “retry scope” and it sounds very promising!

oh , loading icon is on browser tab ? sounds interesting , I will try to search some sites which have such loadings and get back to you
you can check through the uielement(or chrome browser developer tab[I feel it is better than the uiexplorer :stuck_out_tongue: ])if you can detect the loading element present in the code , and try to check characteristics of the element

1 Like