Selenium / Quiz
Await Everything: Promises in the JS Bindings
Every WebDriver command returns a promise, and every forgotten await is a race. The habits that keep Node Selenium deterministic.
- Difficulty
- Easy
- Format
- Quiz
- Points
- 100
- Estimate
- 8 min
// MISSION BRIEF
Your Mission
In the JavaScript bindings there is no synchronous option and no magic queue: driver.get, findElement, click, getText, all return promises, and the browser does not wait for your next line.
This quiz drills the async discipline: what a missing await actually does, promise-vs-value assertions, runner timeouts, and why you cannot parallelize commands on one session.
Speed bonus active.
// FIRST CONTACT
Battle teaser
In selenium-webdriver for Node, driver.findElement(By.id('save')) returns:
- AA promise resolving to a WebElement (rejecting with NoSuchElementError if absent), so callers must await it before using the element
- BA CSS selector string for later use
- CThe WebElement synchronously, like the Java bindings
- DA boolean indicating whether the element exists
Answers, scoring, hints, and the full battle stay sealed.
// SKILL TAGS
seleniumjavascriptasyncpromisesflakiness