How to create a dynamic delay?

I am tryting to create dynamic delay due to wait for ready is not working properly during site loading.

Hi @educadoinstitute
Yes if you want to make the delay dynamic in time then we should NOT use delay
—The reason is when we use delay we will be mentioning a solid timestamp with milliseconds
—So this Delay will wait ti the time gets completely over and now at can be interrupted and continued
—But we do with some other activities like ELEMENT EXISTS, if we are waiting for an element to appear, IMAGE EXISTS if we are waiting for an image to appear, WAIT IMAGE VANISH if we are waiting for an image to vanish, WAIT ELEMENT VANISH if we are waiting for an element to vanish, ON ELEMENT APPEAR if we are waiting for an element to appear which is different from ELEMENT EXISTS as it would give us a Boolean output while on element appear is a container and will execute the activity in its container if that element appear

hope this helps u

Hi,

You can create dynamic delay using loop with element exit activity.
Login put look with false value variable and execute do while loop with element exist in do section and condtion should be like till element exist variable value should not true then loop continue .

we can start with the retry scope activity and develop our custom flow similar to retry scope when we do need more specifics.

Essentials for a custom retry scope flow can be:

  • for each activity looping over Enumerable.Range(1, NoOfRetries)
  • do while

Hi @educadoinstitute

You can use element exists activity to find the element is available in the background or not. Then use element exists activity within retry scope activity to iterate the activity till the element is available. And you have to pass number of retires and max time delay for retry activity to check the element and proceed further.

Explain the business case please @educadoinstitute

Just use Check App State (or On Element Appear if on classic, but you should be on modern) and set the timeout higher than the longest time you expect it to take to load.

You could set the timeout to 5 minutes and if the element appears in 10 seconds, you’ll only see a 10 second delay. It only waits the full timeout if the element does NOT appear.

Hi @educadoinstitute

do you have any more queries on the topic