Selenium Interview Questions
By Aaron Cao · Updated

Selenium interviews focus on waits, locators, the Page Object Model and why tests turn flaky. Expect to explain implicit against explicit waits, choose CSS over XPath and defend it, resolve a stale element error, and describe how your framework runs in parallel.
What do interviewers ask about waits and locators?
You have written tests that pass locally and fail in the pipeline, and you suspect the answer involves waits without being able to state it cleanly. Interviewers know this, which is why waits open most Selenium rounds. This section covers what a complete answer sounds like.
- Implicit versus explicit wait. An implicit wait is a global setting that polls for element presence on every lookup. An explicit wait targets one element and one condition, such as clickable or visible. Explicit is preferred because it states what you are waiting for.
- Why should you not mix them? Combining both can compound timeouts in ways that are hard to predict, which is why most teams set the implicit wait to zero and use explicit waits throughout.
- What is a fluent wait? An explicit wait with a configurable polling interval and ignored exception types.
- Why is
Thread.sleepwrong? It is unconditional. It slows a passing test and still fails a slow one. - CSS selector or XPath? Prefer a stable test identifier attribute, then CSS for readability. XPath earns its place when you must traverse to a parent or match on text.
- What makes a locator brittle? Auto-generated class names, absolute XPath, and index-based selection. Say what you would ask a developer to add instead.
Interviewers are listening for the reason behind each choice. Naming a preference without the cost attached reads as a memorized answer.
How do you answer the exception and flakiness questions?
Flaky tests are the real subject of most senior automation interviews, because a suite nobody trusts is worse than no suite.
- What causes
StaleElementReferenceException? The element reference points at a node that is no longer attached, usually because the framework re-rendered that part of the page. Re-find the element rather than reusing the stored reference. - What about
ElementNotInteractableException? The element exists but cannot be acted on: hidden, disabled, covered by an overlay, or off screen. - How do you handle
NoSuchElementException? Distinguish a timing problem from a genuinely absent element, and do not paper over it with a longer sleep. - Why do tests fail only in the pipeline? Different viewport size, slower environment, missing test data, animations that finish later, and parallel tests colliding on shared state.
- How do you fix a flaky test? Diagnose the category first, then fix the cause. Auto-retry hides failures and is a last resort you should name as such.
- How do you handle frames, new windows and alerts? Switching context explicitly, and switching back afterwards.
A QA engineer interviewing for a mid-level automation role was asked why one suite failed twice a week with no code change. The answer that landed was not a Selenium API detail, it was that the tests shared a single seeded account and raced each other. Interviewers reward that diagnostic order: environment and data first, API second.
More banks by role and tool sit under interview questions by role.
Which framework and architecture questions come up?
Beyond the API, panels want to know whether you can own a suite. These questions carry the most weight for senior roles.
- Explain the Page Object Model. Page classes expose actions and hide locators, so a UI change touches one file. Say what problem it solves; describing the folder layout alone misses the point.
- What goes wrong with Page Objects? They grow into thousand-line classes and start asserting inside page methods. Assertions belong in tests.
- How does your framework run tests in parallel? Thread-safe driver management so instances are not shared across threads, plus independent test data per test.
- What is Selenium Grid for? Distributing tests across machines and browser versions, with a hub and nodes, or a cloud provider playing the same role.
- What changed in Selenium 4? The W3C WebDriver protocol became standard and the old JSON wire protocol was removed, relative locators arrived, and Chrome DevTools Protocol access was exposed.
- When would you not use Selenium? API-level checks, unit-testable logic, and anything outside the browser. Knowing the boundary is a senior signal.
- How do you decide what to automate? Stable, high-value, repetitive paths. Not everything, and not a screen still being redesigned.
How should you practice before the interview?
Selenium answers are unusually easy to know and hard to say. The wait question in particular has a two-part answer, the definition and the reason, and candidates who have only read it deliver the first half and trail off.
Take the five questions here you would least like to face and answer each aloud in ninety seconds with no editor open. Then have someone ask the follow-up, which is almost always why. Running the same prompts against an AI interviewer that pushes back is closer to a real round than rereading a list, and that is what mock interview mode exists for.
Aaron Cao, founder of SubcueAI, built practice around that speaking gap rather than around supplying more questions. In a live interview the desktop app and the browser extension Side Panel can surface structure as the interviewer speaks, which helps most on material you have already rehearsed. What the product does, and the limits it does not cross, are set out on the security page.
FAQ
Is Selenium still worth learning with Playwright and Cypress around?
Which language should I use in a Selenium interview?
Do Selenium interviews include live coding?
Can Selenium handle CAPTCHA or file upload dialogs?
Can an AI assistant help me during a live automation interview?
Related questions
- What Databricks interview questions should I expect?
- What .NET interview questions should I expect?
- What quality engineer interview questions should I expect?
- What quant interview questions should I expect?
- What Snowflake interview questions should I expect?
- What teacher interview questions should I expect?