Please mention the major differences between selenium.wait(2000) and Thread.sleep(2000) as both are used to make the test case wait for that amount of time.
Asked
Active
Viewed 1,100 times
-2
-
1Do you have a specific concern? This sounds like some kind of interview question you got and didn't know the answer for. If so, say so, and explain what research you did and why you're still confused. – T.J. Crowder Feb 21 '13 at 12:53
-
And both are bloody stupid, you should be using an explicit wait that will return as soon as it finds what you are waiting for. Static waits like shown above slow your tests down and make them brittle. The wait's you put in will obviously be tailored for your machine, on somebody else machine they will either wait too long, or not long enough. – Ardesco Feb 22 '13 at 10:54
2 Answers
-1
The first method which you are talking about is method of java.lang.Object
public final void wait(long timeout) throws InterruptedException
refer http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html#wait(long)

Jaydeep Rajput
- 3,605
- 17
- 35