Selenium and browser automation interview questions, 2026
The bulk of practical SDET interviews.
Selenium questions dominate practical SDET interviews in India. Expect questions on waits (why time.sleep is wrong, when to use explicit vs implicit), Page Object Model, handling flaky tests, locator strategies (CSS vs XPath), browser drivers, and how to scale a suite (Selenium Grid, Docker, parallel runs). The same patterns apply to Playwright and Cypress; the names of the APIs differ.
Q1Why is `time.sleep()` problematic in Selenium tests?
What the interviewer is really listening forLooking for: explicit waits, brittleness, slow suites.
Sketch answer (adapt, do not memorise)It's always too short or too long. Too short on slow CI runners → flaky failures. Too long on fast machines → 100 tests × 3s = 5 minutes wasted. Explicit waits (`WebDriverWait(driver, 10).until(EC.condition)`) return as soon as the condition holds, fast when the app is fast, robust when it isn't.
Q2What's the Page Object Model and what problem does it solve?
What the interviewer is really listening forLooking for: separation of concerns, maintainability, readable tests.
Sketch answer (adapt, do not memorise)A class per page. Methods describe what the user does, `loginPage.login(email, pw)`, not how they do it. Selectors live inside the page class. When the DOM changes, only the page class changes; tests stay untouched. It solves: "DOM changed → 50 tests broke."
Q3You have a flaky test. How do you handle it?
What the interviewer is really listening forLooking for: flakiness as a bug, not a nuisance. Quarantine + investigate.
Sketch answer (adapt, do not memorise)Flaky tests destroy signal, the team stops trusting CI. So I quarantine the test (skip it in mainline, run it separately), then investigate the *real* cause: race conditions, timing, shared state, network. Auto-retry hides intermittent bugs and is a last resort, not a fix.
More interview prep
- QA fundamentals →3 questions
- Requirement analysis →2 questions
- Test design techniques →2 questions
- Defects and bug reporting →2 questions
- API testing →2 questions
- Test framework and CI →2 questions