cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Sleep

Vijaya_KumarA
Level 3
4 REPLIES 4

Denis__Dennehy
Level 15
In 99% of times you should not be using Sleep as it is an arbitrary wait.  Your Blue Prism training will have taught you to always use intellegient waits (where you wait for an element or you wait for something to happen) wherever possible as they are more robost and more efficient.   The Sleep action was created because there is no wait stages in Process studio and should only be used for building polling lkogic in your process (examples of this are in the advanced proces templates, but effectivelly look for new work, none found, sleep, look for new work again etc...). If your senior developer or mentor ever sees sleeps being used in object studio or instead of intelligent waiting logic he should shout loudly!!

JamesCox-Schemb
Level 2
Denis Shouldn't a small wait stage be used in objects after navigate stages, such as when activating a window or mouse clicking? Therefore using an arbitrary wait. These are just a few quotes and an attached image from the surface automation training guide for v5: ""Wait a tiny amount of time (for example, 0.1 seconds) to give the Activate time to work. Without waiting for activate to work your action may not work when running at full speed in control room."" ""Add a wait stage, not waiting for any elements, but simply waiting for 0.5 seconds to give the Login Screen time to become active. This is required because some elements are not instantly ready to receive input after a mouse click."" ""Add a small wait for 0.25 seconds after your new action stage."" So my question is are there any differences in Blue Prism performance when using the sleep function (for 0.1 seconds) or using a wait stage (with no parameters but continuing after a 0.1 second timeout)?

SurajJadhav
Level 5
Hello james ,   If you are using BluePrism Newer version 6 or above you have an option in navigate stage to pause after every step this will give your object more robustness instead of using arbitrary wait stages.

JamesCox-Schemb
Level 2
Hi Suraj We are using Blue Prism 5 and don't have any immediate plans to upgrade, therefore we are using arbitrary wait stages. I'm intrigued by Denis' comment about a senior developer shouting if sleeps are used in an object, as this implies they do something different to a standard wait stage being used as an arbitrary wait?