“Sleep” statement in Watir

When you perform testing through any automation testing tool then you also want to see that how your application works with that but it’s not possible with tools. Because mostly all tools are working in milliseconds that’s why we are not able to see real time functions. For this requirement most testing tools uses “wait” or synchronization function. But when I was working on Watir then I faced one problem that, how can I wait ruby script then I discussed my problem with my Ruby Programmer (Rahul). He suggest me to use sleep statement for waiting the script and found it really works. Thanks to Rahul!

So you can also use sleep statement for waiting the script in Watir.

Syntax :-

# Sleep for 6 seconds

sleep 6 (Always use small latter for defining the Variable in Watir script)