medium10 pts · first answer countsseleniumflaky-tests
Replacing Thread.sleep in Selenium
A Selenium test uses Thread.sleep(8000) before clicking a button that loads slowly. What is the better approach?
driver.findElement(By.id("load")).click();
Thread.sleep(8000);
driver.findElement(By.id("pay")).click();Discussion 0
Join free to post in the discussion.
Related questions
- Flaky Playwright visibility checkQA Engineer
- Tests fail only in parallelQA Engineer
- Passed on retryQA Engineer
- Noisy screenshot testsQA Engineer
- Testing an eventually consistent APIQA Engineer
- What makes a test flakyAutomation Test Engineer
- How Selenium talks to a browserAutomation Test Engineer
- StaleElementReferenceExceptionAutomation Test Engineer