What is the difference
between thread. Sleep () and selenium. Set Speed ("2000")?
If
the application is taking time to load the page then we use
selenium.waitforpageload(" "). This command is doesn’t wait upto the
given time whenever the page load is completed.
If
the application is taking time to refresh the page, then we use Thread. Sleep (
).it is a standard wait it simply wait to the given time.
selenium.setSpeed
1. Takes a single argument in string format
Ex: selenium.setSpeed("2000") - will
wait for 2 seconds
2. Runs each command in after setSpeed delay
by the number of milliseconds mentioned in set Speed.
thread.sleep
1. Takes a single argument in integer format
ex: thread. Sleep(2000) - will wait for 2
seconds
2. Waits for only once at the command given at
sleep.
Where we need to set this?
ReplyDeletewithin a Test ? / Class ? / ?????
set in the metod which is inside the class
DeleteIs this "Sleep" or "Speed"?
ReplyDeletethese are both Sleep is the method which is used to keep delay the process
Deleteand
speed same as sleep but in selenium you are using setSpeed(integer value)
to execute your script as fast or slow depends on your given value
1sec =1000
setSpeed() command is not available in WebDriver, Alternate always we can use Implicit and explicit waits.
ReplyDeleteNote: check in selenium IDE, we can use setSpeed method
so you can use Thread.sleep("integer value") this also same as setSpeed Method
DeleteSol : of Amit: SET in the method which is inside the class
ReplyDeletehi
ReplyDeleteWhile doing refreshing the page i prefer thread.sleep(),
ReplyDeleteBut regularly i am using implicit wait only
Is thsi correct way?
Thanks
Swathi bommavaram