InterviewSolution
| 1. |
What is the difference between setSpeed() and sleep() methods? |
|
Answer» Both setSpeed() and sleep() will delay the speed of script execution. THREAD.sleep(): It will stop the current execution of script thread for a specified period of time. It is done only once and it takes a single ARGUMENT in integer format For example: thread.sleep(2000)- Execution of the script will be stopped for 2 seconds It waits only once at the command given at sleep. SetSpeed(): It will stop the execution of each and every selenium command for a specific amount of time and it takes a single argument in integer format For example selenium.setSpeed(“2000”)- It will wait for 2 seconds for each and every command before the execution of the next command. It runs each command after setSpeed delay by the number of milliseconds mentioned in set Speed. |
|