Selenium / Quiz

driver.wait and the until Arsenal

elementLocated vs elementIsVisible, custom condition functions, the timeout message nobody sets, and where WebDriverWait went in JavaScript.

Difficulty
Medium
Format
Quiz
Points
150
Estimate
10 min

// MISSION BRIEF

Your Mission

Java testers ask where WebDriverWait lives in the JS bindings. Answer: it dissolved into a method, driver.wait(condition, timeout), fed by the until module and by any function you write.

This quiz covers the JS waiting toolkit: what until conditions return, which take locators versus elements, custom predicates, implicit timeouts via setTimeouts, and the diagnostics you get on failure.

Speed bonus active.

// FIRST CONTACT

Battle teaser

const el = await driver.wait(until.elementLocated(By.id('status')), 10000); What lands in el?

  1. AThe located WebElement itself, elementLocated resolves to the element, so wait-and-use is a single expression
  2. BAn array of all matching elements
  3. CThe locator, which you still pass to findElement
  4. DA boolean confirming the element exists
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

seleniumjavascriptwaitssynchronizatione2e-testing