Interview Questions

SELENIUM REAL TIME INTERVIEW QUESTIONS - What is the difference between thread.Sleep() and selenium. Set Speed ("2000")?

Selenium WebDriver Interview question and Answers


(Continued from previous question...)

SELENIUM REAL TIME INTERVIEW QUESTIONS - 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.

(Continued on next question...)

Other Interview Questions