← Quiz: Waits: all 10 questions
Quiz: Waits · Question 2 of 10
Why is Thread.sleep a poor way to wait?
Why is Thread.sleep a poor way to wait?
- A.Java doesn't allow it in tests
- B.It always waits the full time and still fails if the page is slower than expected
- C.It closes the browser
- D.It only works in Chrome
Answer & explanation
Correct answer: It always waits the full time and still fails if the page is slower than expected
Fixed sleeps make suites slow and flaky at the same time.
Can you get the rest right without peeking?
Take the timed Quiz: Waits quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →