🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Java doesn't allow it in tests
  2. B.It always waits the full time and still fails if the page is slower than expected
  3. C.It closes the browser
  4. 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 →