Automation Question:
Download Questions PDF

Explain me what is the difference between setSpeed() and sleep() methods?


Both of these methods delay the speed of execution. The main difference between them is setSpeed sets a speed while will apply delay time before every Selenium operation takes place. thread.sleep() will set up wait only for once.

For Example:
☛ sleep(5000)- It will wait for 5 seconds. It is executed only once, where the command is written.
☛ setSpeed("5000")- It also will wait for 5 seconds. It runs each command after setSpeed delay by the number of milliseconds mentioned in set Speed.

Download Automation Interview Questions And Answers PDF

Previous QuestionNext Question
Do you know what is the difference between "type" and "typeAndWait" command?Tell me could cookies be deleted in Selenium?