Skip to content
SDETRole
SDETRole

Interview questions / UI Automation

Selenium Interview Questions

Selenium WebDriver questions test whether you understand the protocol, synchronisation and the framework patterns around it, not just the API.

7 questions · 3 beginner· 2 intermediate· 2 advanced

beginner questions

intermediate questions

advanced questions

What Selenium interviews cover at each level

Entry-level rounds check that you can use the API correctly: locator strategies, findElement versus findElements, and why Thread.sleep is a bad wait. Mid-level rounds focus on synchronisation and recovery: explicit and fluent waits, StaleElementReferenceException, frames, windows and alerts. Senior rounds become Selenium framework interview questions: how WebDriver talks to the browser, how you structure page objects, how you run tests in parallel without sharing a driver between threads, and how Selenium Grid 4 routes sessions.

Concepts to study first

  • WebDriver architecture: your code sends W3C WebDriver commands over HTTP to a driver (chromedriver, geckodriver), which controls the browser. Selenium Manager can now download the matching driver automatically.
  • Waits: explicit waits poll for a specific condition; implicit waits apply to every element lookup. The Selenium documentation warns against mixing them because the resulting timeouts are unpredictable.
  • Locator strategy: stable ids and data attributes first, CSS for structure, XPath when you need text or axes such as following-sibling.
  • Thread-safe parallel execution: one driver per thread, usually held in a ThreadLocal<WebDriver>, and no static driver fields.

A worked answer: stale elements

Asked "how do you handle StaleElementReferenceException?", a weak answer is "catch it and retry". A strong answer explains the cause first: the element reference points at a DOM node that was removed or re-rendered, often after an AJAX refresh. The fix is to locate the element again after the change, ideally by waiting for the change itself, for example wait.until(ExpectedConditions.stalenessOf(oldRow)) followed by a fresh findElement. Page objects that store By locators rather than WebElement fields avoid most stale references, which is one reason many teams avoid PageFactory. See the full answer on stale element handling.

Framework design questions

Selenium framework interview questions usually start with "walk me through your framework". Interviewers want layers with clear responsibilities: a driver factory that creates browsers from configuration, page objects that expose user actions (loginAs(user)) rather than raw elements, test classes that read like specifications, and test data and environment settings kept outside the code.

Be ready to explain how the same suite runs locally and on Selenium Grid 4 through RemoteWebDriver, how you capture screenshots and logs on failure, and how you keep the suite fast as it grows: run in parallel, move checks that do not need a browser to the API layer, and delete tests that duplicate coverage.

Practise beyond reading

The Selenium practice lab resolves your XPath and CSS locators against real HTML and checks your Java wait, frame and page-object code against pattern rules (it is not compiled). Pair it with the Selenium waits explained article and the Java interview questions, since most Selenium frameworks are written in Java.

Type to search across SDETRole.

Full-text search by Pagefind · runs in your browser Open search page →