← QA

Selenium Interview Questions and Answers

Selenium WebDriver for QA automation: drivers and Selenium Manager, locators, CSS and XPath, waits, exceptions, frames, windows and alerts, the Actions API, page objects and components, Grid 4 and Docker, capabilities, WebDriver BiDi, downloads and uploads, parallel runs, flaky tests and framework design.

225 questions for Selenium interviews with answers and explanations - Junior, Middle and Senior levels. Sample questions, online quizzes and coding tasks.

Questions by level

Sample questions

A few questions from each level with the correct answer and an explanation.

Selenium · Junior

  1. What is Selenium WebDriver?
    Show the answer

    Correct answer: A library that drives real browsers through a standard protocol

    WebDriver sends commands to a browser driver (chromedriver, geckodriver) using the W3C WebDriver protocol. Test runners like JUnit or TestNG run the tests.

  2. What does a browser driver like chromedriver do?
    Show the answer

    Correct answer: Translates WebDriver commands into actions in that browser

    Each browser has its own driver. Selenium sends HTTP requests to it, and the driver controls the browser.

  3. What does Selenium Manager (Selenium 4.6+) solve?
    Show the answer

    Correct answer: It finds or downloads the right driver for the browser automatically

    You no longer need to download chromedriver by hand or use a separate WebDriverManager library in most cases.

  4. How do you open a page in Selenium Java?
    Show the answer

    Correct answer: driver.get("https://example.com")

    get waits for the page load event by default. navigate().to() does the same and keeps history methods like back().

All 75 questions with answers →

Selenium · Middle

  1. Why can @FindBy fields with PageFactory cause stale element errors?
    Show the answer

    Correct answer: The proxy may hold an element that was re-rendered after the first lookup

    With caching (@CacheLookup) the element is reused even after the DOM changed. Many teams use By locators and find on each call instead.

  2. What is a page component (or fragment) object?
    Show the answer

    Correct answer: An object for a reusable part, like a header or table, used by several pages

    Components avoid copying the same header locators into every page object.

  3. Where should the constructor of a page object check that it's on the right page?
    Show the answer

    Correct answer: It should wait for a key element so wrong navigation fails early

    Failing at the right place gives clear errors instead of NoSuchElement three steps later.

  4. What is the purpose of a driver factory?
    Show the answer

    Correct answer: Create configured drivers from settings like browser, headless or Grid URL

    Tests ask for a driver and don't care how it's built; switching to Grid is a config change.

All 75 questions with answers →

Selenium · Senior

  1. What layers does a maintainable Selenium framework usually have?
    Show the answer

    Correct answer: Tests, business flows, page and component objects, driver and config layers

    Each layer changes for its own reasons: UI changes hit pages, business rules hit flows, infrastructure hits driver and config.

  2. Why is classic WebDriver slower per action than tools using CDP or BiDi directly?
    Show the answer

    Correct answer: Each command is a separate HTTP round trip to the driver

    On a remote Grid every findElement and click pays network latency. Fewer, coarser commands and BiDi help.

  3. A suite on a remote Grid is twice as slow as locally. What is a likely cause?
    Show the answer

    Correct answer: Network latency multiplied by thousands of fine-grained commands

    Move runners close to the Grid, cut chatty helpers like repeated isDisplayed polling, and parallelize.

  4. How should a team decide which browsers to run in CI?
    Show the answer

    Correct answer: Use real user analytics, with full runs on main browsers and smoke on others

    Cross-browser cost grows fast. Focus depth where users are and cover the rest with smoke tests.

All 75 questions with answers →

Coding tasks

Write your solution right in the browser, and tests check it instantly. JavaScript interview classics (debounce, deepClone, Promise.all, an LRU cache), TypeScript tasks on generics, narrowing and utility types checked by the real compiler, Node.js backend logic (middleware, rate limiters, job queues), SQL queries in real PostgreSQL, and React components and hooks like a todo list, tabs, useDebounce and useInterval.

Open tasks →