Interview questions

Selenium Interview Questions

17 Selenium interview questions on WebDriver, locators, waits, Grid, page objects and flaky tests, with model answers for testers and interviewers.

Selenium Interview Questions

What's here

17 Selenium interview questions, grouped into 4 areas: webdriver fundamentals, waits and synchronisation, framework design and practical scenarios. Each one comes with why it is worth asking and what a strong answer contains, so the same question can be scored the same way by different interviewers.

  • Ask candidates to fix a deliberately flaky test; it tests waits, locators and debugging in one task
  • Probe the implicit versus explicit wait answer with a follow-up about mixing them
  • Ask to see or describe a framework they built, including how they handle test data
For hiring teams

Cohesyve finds, contacts and tests Selenium candidates on the real work, then ranks them for these interviews. 14-day free trial for 10 candidates, not charged until it ends.

Preparing for this interview yourself? Practise it free →

Selenium interview questions come up for QA engineers, automation testers and SDETs. Selenium is a suite: WebDriver for driving browsers from code, Selenium IDE for recording tests in the browser, and Selenium Grid for running tests on remote machines in parallel. Interviewers want to know whether a candidate can write stable, maintainable browser tests, beyond knowing the API. Candidates can use the 'what to look for' notes as model answers; interviewers can use them as a scoring guide.

WebDriver Fundamentals

The core concepts every Selenium interview checks.

  1. 1

    What are the components of Selenium, and what does each do?

    Why ask it

    A warm-up that checks the candidate knows the tool beyond one API.

    What to look for

    WebDriver (a language-bound API that drives a real browser through a browser-specific driver), Selenium IDE (a browser extension for recording and playing back tests, useful for quick prototypes) and Selenium Grid (runs WebDriver scripts on remote machines, in parallel and across browsers and platforms). Good candidates mention Selenium Manager, included since Selenium 4.6, which finds, downloads and caches the right browser driver automatically.
  2. 2

    Which locator strategies do you use, and in what order of preference?

    Why ask it

    Locator choice decides how brittle a test suite is.

    What to look for

    Stable, unique IDs or dedicated test attributes (such as data-testid) first, then name and CSS selectors, with XPath for cases CSS cannot handle (text matching, moving up the tree). Avoid absolute XPaths and selectors tied to layout or generated class names. Strong candidates say they ask developers to add test attributes.
  3. 3

    What is the difference between findElement and findElements?

    Why ask it

    A small detail that causes real bugs.

    What to look for

    findElement returns the first match and throws NoSuchElementException if none exists; findElements returns a list, empty if nothing matches. findElements is useful to check that something is absent without catching exceptions.
  4. 4

    How do you handle alerts, frames and multiple windows or tabs?

    Why ask it

    Common real-world obstacles.

    What to look for

    switchTo().alert() to accept, dismiss or read alerts; switchTo().frame() by index, name or element and switchTo().defaultContent() to return; getWindowHandles() and switchTo().window(handle) for new windows or tabs, then closing and switching back. Good answers mention waiting for the new window to appear.
For hiring teams

Before the Selenium interviews, see who can do the work

Cohesyve finds and contacts Selenium candidates from your job description and tests each one on an AI job simulation of the role, so these questions go to a ranked shortlist. 14-day free trial for 10 candidates, not charged until it ends.

Waits and Synchronisation

Timing problems cause most flaky Selenium tests, so interviewers dig here.

  1. 5

    What is the difference between implicit and explicit waits?

    Why ask it

    The single most asked Selenium question, and the source of many flaky suites.

    What to look for

    An implicit wait is a session-wide setting that makes every element lookup wait up to a timeout (the default is zero). An explicit wait polls for a specific condition (element clickable, text present) up to a timeout for one step. The Selenium docs say not to mix them, because combining them can produce unpredictable wait times. Most teams prefer explicit waits.
  2. 6

    Why is Thread.sleep a bad idea in Selenium tests?

    Why ask it

    Hard-coded sleeps are a sign of inexperience.

    What to look for

    Fixed sleeps either waste time when the page is ready early or fail when it is slow. Explicit waits on a meaningful condition are faster and more reliable.
  3. 7

    What causes a StaleElementReferenceException, and how do you fix it?

    Why ask it

    A very common error in dynamic web apps.

    What to look for

    The element was found, then the DOM changed (re-render, navigation, refresh), so the reference no longer points to the live element. Fixes: re-find the element after the change, wait for the update to finish, and avoid storing element references for long in page objects (find them when needed).
  4. 8

    A test passes locally but fails intermittently in CI. How do you investigate?

    Why ask it

    Flaky tests are the main pain of UI automation.

    What to look for

    Check screenshots, logs and videos from the failing run, look for timing assumptions, test data shared between parallel tests, environment differences (screen size, headless mode, browser version), and order dependence. Fix the root cause rather than adding retries; quarantine the test while fixing so it does not erode trust in the suite.

Framework Design

Whether the candidate can build a suite that a team can maintain.

  1. 9

    What is the Page Object Model, and why use it?

    Why ask it

    The standard pattern for maintainable UI tests.

    What to look for

    Each page or component becomes a class that holds its locators and exposes user-level actions (login(user, password)), so tests read like scenarios and a UI change is fixed in one place. Page objects should not contain assertions about test outcomes in most designs. Mentions of component objects for reused widgets show maturity.
  2. 10

    How do you structure test data and configuration across environments?

    Why ask it

    Hard-coded data and URLs make suites fragile.

    What to look for

    Environment config in files or environment variables, test data created through APIs or fixtures rather than the UI, unique data per test to allow parallel runs, and clean-up after tests. Secrets kept out of the repository.
  3. 11

    How do you run Selenium tests in parallel?

    Why ask it

    Suite speed matters in CI.

    What to look for

    A test runner that supports parallel execution (TestNG, JUnit 5, pytest-xdist), a separate driver instance per thread, independent test data, and Selenium Grid or a cloud grid for many browsers. Tests must not depend on each other's state.
  4. 12

    Which test runner and reporting do you use with Selenium, and why?

    Why ask it

    Shows the candidate has built or maintained a real framework.

    What to look for

    A runner suited to the language (TestNG or JUnit for Java, pytest for Python, NUnit for C#), assertions, fixtures for setup and teardown, and reports with screenshots on failure. Integration with CI so tests run on every merge.
  5. 13

    What should be automated through the UI, and what should not?

    Why ask it

    Over-automating the UI is a common and costly mistake.

    What to look for

    Keep UI tests for critical user journeys; push most checks down to unit and API tests, which are faster and more stable (the test pyramid). Avoid automating CAPTCHAs, one-off checks and features that change constantly.

Practical Scenarios

Short tasks that show hands-on depth.

  1. 14

    How would you automate selecting an option from a custom drop-down that is not a native select element?

    Why ask it

    Modern UIs rarely use plain select elements.

    What to look for

    The Select class only works with native select elements. For custom drop-downs: click to open, wait for the options list, then click the option by its text or test attribute. Keyboard input can be an alternative.
  2. 15

    How do you handle file uploads and downloads in Selenium?

    Why ask it

    Common requirements with known workarounds.

    What to look for

    Upload by sending the file path to the file input element with sendKeys, without opening the operating system dialog. Downloads are better verified by configuring the browser's download directory through options, or by checking the download link through an HTTP request.
  3. 16

    When would you use JavaScriptExecutor, and what are the risks?

    Why ask it

    A tool that is useful but often misused.

    What to look for

    Scrolling, reading values that are hard to reach, or debugging. Clicking or setting values through JavaScript skips the browser's real user interaction, so the test may pass even when a real user could not click the element. Use it sparingly.
  4. 17

    How does Selenium compare with tools such as Playwright or Cypress?

    Why ask it

    Teams often weigh alternatives; candidates should know the landscape at a high level.

    What to look for

    A balanced view: Selenium supports many languages and browsers through the WebDriver standard and has a large ecosystem; newer tools offer built-in auto-waiting and tracing with different language and browser support. A good candidate picks based on the team's language, browsers and existing suite.

Running the interview well

  • 1Ask candidates to fix a deliberately flaky test; it tests waits, locators and debugging in one task
  • 2Probe the implicit versus explicit wait answer with a follow-up about mixing them
  • 3Ask to see or describe a framework they built, including how they handle test data
  • 4Check that they know when not to automate through the UI
  • 5Use a live page and ask for robust locators for three elements
  • 6Give credit for test design thinking, not only for Selenium API recall

Common questions

What are the most common Selenium interview questions?

Implicit versus explicit waits, locator strategies, findElement versus findElements, handling frames, alerts and windows, StaleElementReferenceException, the Page Object Model, Selenium Grid and parallel runs, and how you deal with flaky tests.

What are Selenium IDE interview questions about?

Selenium IDE is the record-and-playback browser extension. Questions usually cover when it is useful (quick prototypes, reproducing bugs, onboarding), its limits for large suites, and how recorded tests compare with WebDriver code.

Which language should I use for Selenium interviews?

Use the language in the job description. Java and Python are common, and the concepts are the same across languages. Be ready to write a short test in that language with a runner such as TestNG, JUnit or pytest.

How should a manual tester prepare for a Selenium interview?

Learn one language's basics, automate a few real flows on a practice site using page objects and explicit waits, push the project to a repository and be ready to explain your design choices. Your test design experience from manual testing is valuable, so connect it to what you automate.

Do I need to know Selenium Grid?

For most automation roles, know what it does: it runs WebDriver tests on remote machines so you can test in parallel and across browsers and platforms. Senior roles may ask how you would set it up or use a cloud grid.

Is Selenium still used in 2026?

Yes. Selenium is actively maintained and is widely used in existing test suites, alongside newer tools. Many job descriptions for automation testers list it.

For hiring teams

Save these questions for the Selenium candidates who can do the work

Cohesyve takes your Selenium job description, finds candidates, reaches out to them and runs an AI job simulation of the real work, then returns a ranked shortlist.

1,500+

assessments completed

50%

faster time-to-hire

5 min

from JD to assessment

14-day free trial · 10 candidates · Not charged until the trial ends

For job seekers

Preparing for a Selenium interview yourself? Practise on an AI job simulation of the role. 3-day free trial, cancel anytime.

Practise a Selenium interview free →

See Cohesyve in action

Free 30-min walkthrough

See it on your role