Selenium interview questions — Medium
502 medium-level Selenium questions from our Automation Testing bank, each with the correct answer and an explanation of why it is correct.
What this covers
Selenium appears throughout Automation Testing interviews. At medium level, interviewers are typically checking that you have used it in practice: what you configured, what broke, and how you knew it worked. Work through these, then explain your answer out loud; the second part is what interviews actually test.
3 example questions
1. In Selenium WebDriver, which wait polls the DOM until a specific condition is met, throwing only if it times out?
- A. Thread.sleep().
- B. Implicit wait.
- C. Explicit wait (WebDriverWait + ExpectedConditions).correct
- D. Page load timeout.
Why: Explicit waits (WebDriverWait with ExpectedConditions) poll until a condition is true or the timeout elapses — more reliable than fixed sleeps or a global implicit wait.
2. What does driver.findElements() return when no matching elements are found?
- A. Null.
- B. Throws NoSuchElementException.
- C. An empty list.correct
- D. A single empty WebElement.
Why: findElements() returns an empty List when nothing matches (no exception), whereas findElement() throws NoSuchElementException.
3. What is Selenium Grid primarily used for?
- A. Recording manual test cases.
- B. Running tests in parallel across multiple machines/browsers.correct
- C. Mocking REST APIs.
- D. Generating performance load.
Why: Selenium Grid distributes test execution across multiple nodes/browsers/OSes, enabling parallel, cross-browser runs.