What is the difference between Thread.Sleep() and Selenium.setSpeed()?

1,784 views
Skip to first unread message

Abadhesh Panda

unread,
Jun 16, 2012, 7:35:48 AM6/16/12
to seleniu...@googlegroups.com
Hi All,

can you tell me the difference??


Thanks
Abadhesh

praveen patil

unread,
Jun 16, 2012, 1:34:08 PM6/16/12
to seleniu...@googlegroups.com
Thread.sleep will halt ur script at the step u r using and not at every step.
selenium.setspeed halts ur script after each action/step performed on the application and this will be time consuming way


Abadhesh

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
             PRAVEEN PATIL
"No Man is worth ur tears and the one who is.... ... wont make u cry....."

Smita Sinha

unread,
Jun 18, 2012, 2:16:22 AM6/18/12
to seleniu...@googlegroups.com

Abadhesh Panda

unread,
Jun 18, 2012, 2:28:19 AM6/18/12
to seleniu...@googlegroups.com
Thanks Smita..

Abadhesh Panda

unread,
Jun 18, 2012, 2:29:53 AM6/18/12
to seleniu...@googlegroups.com
Thanks Pravin,

its fine can u give some code example how to exactly use these to command??

On Sat, Jun 16, 2012 at 11:04 PM, praveen patil <praveen...@gmail.com> wrote:

praveen patil

unread,
Jun 18, 2012, 2:43:33 AM6/18/12
to seleniu...@googlegroups.com
Hi Abadhesh,

Thread.sleep - This will help in resolving sync issues with the objects taking time to load when u use in a for loop waiting for an object. Once the objects is loaded, even though the the max wait time u have given is not reached, ur script will skip the loop and continue with next thereby reducing the script execution time.

Selenium.setspeed - Assume u hv given 5000 ms in setspeed, ur script will halt for 5sec after performing every action(command) even when the object is loaded properly. This will increase ur script execution time. The less Selenium.setspeed time given the better.

Regards,
Praveen
Reply all
Reply to author
Forward
0 new messages