Selenium Interview Questions (2026)

Practice 45 Selenium interview questions on WebDriver, locators, waits, page objects, frames, alerts, actions, Grid, CI, flaky tests, and browser automation.

45 questions with answers

What Is Selenium?

Key Takeaways

  • Selenium is an open-source browser automation project used mainly for testing web applications through WebDriver.
  • Interviews test locators, waits, browser sessions, elements, frames, alerts, actions, page objects, Grid, CI, and flaky-test debugging.
  • Strong Selenium answers explain synchronization and locator strategy before writing code.
  • Selenium does not test APIs, databases, or business logic by itself. It automates browser behavior.

Selenium is a browser automation project used to test web applications through real browsers. Selenium WebDriver sends commands to a browser driver, finds elements, clicks, types, waits, switches contexts, and verifies browser behavior. In interviews, Selenium questions test whether you can write stable UI tests, choose locators, use waits correctly, handle dynamic pages, and debug flaky failures.

45Questions with direct answers
3Groups: WebDriver basics, automation tasks, senior scenarios
7+Flows, tables, videos, code, and quiz
45-75 minTypical Selenium automation round length

Watch: Selenium WebDriver Tutorial in 3 Hours

Video: Selenium WebDriver Tutorial in 3 Hours (Selenium training video, YouTube)

Test yourself and earn a certificate

6 quick questions. Score 70%+ to download your Selenium certificate.

Jump to quiz

All Questions on This Page

45 questions
Selenium Advanced Scenarios
  1. 31. Selenium says element is not clickable. What do you check?
  2. 32. A stale element error appears after a filter changes results. What happened?
  3. 33. A Selenium test passes locally but fails in CI. What do you inspect?
  4. 34. An absolute XPath breaks after a small UI change. What is the lesson?
  5. 35. A suite uses Thread.sleep everywhere. What is the risk?
  6. 36. Parallel tests fail because they use the same user account. What changes?
  7. 37. A modal alert blocks the browser. What should the test do?
  8. 38. Grid runs are queued for too long. What do you inspect?
  9. 39. A team automates every UI path with Selenium. What is the issue?
  10. 40. The locator is correct but Selenium cannot find the element. What might be missing?
  11. 41. Drag-and-drop works manually but fails in Selenium. What do you check?
  12. 42. A Selenium test only clicks through screens and passes. What is wrong?
  13. 43. Tests stop after browser update. What do you check?
  14. 44. A checkout test fails randomly after payment submit. What do you inspect?
  15. 45. What do you ask before approving a Selenium framework?

Selenium Fundamentals

Foundational15 questions

Start here. These are the definitions and first-principle checks that open most rounds.

Q1. What is Selenium WebDriver?

Selenium WebDriver is the API that controls a browser through browser-specific drivers.

It sends commands such as find element, click, type, and open pages in a real browser.

WebDriver changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Watch a deeper explanation

Video: Selenium WebDriver Tutorial in 3 Hours (Selenium training video, YouTube)

Q2. What does a browser driver do?

A browser driver translates WebDriver commands into browser actions.

ChromeDriver, GeckoDriver, and EdgeDriver are common examples.

Browser driver changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q3. What is a Selenium locator?

A locator tells WebDriver how to find an element on the page.

Common locators include id, name, CSS selector, XPath, link text, and tag name.

Locator changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q4. When do you use CSS selectors?

Use CSS selectors for stable, readable element selection based on ids, classes, attributes, and hierarchy.

CSS is usually faster and cleaner than complex XPath.

CSS selector changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Answer partWhat to sayEvidence to mention
DefinitionCSS selector in one direct sentence.Official docs or course material
Use caseThe work where it changes a decision.Dataset, model, query, dashboard, or pipeline
RiskWhat breaks when it is misunderstood.Metric, log, test result, or review note

Q5. When is XPath useful?

XPath is useful when locating by text, complex relationships, or document structure not covered cleanly by CSS.

Avoid brittle absolute XPath.

XPath changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Stable Selenium test path

1Locator
stable target
2Wait
ready state
3Action
user behavior
4Assert
business result

Flaky tests usually fail at locator or wait design.

Watch a deeper explanation

Video: Selenium course for beginners (freeCodeCamp.org, YouTube)

Q6. What is implicit wait?

Implicit wait makes WebDriver poll for elements for a set time before throwing not found errors.

It is global and can hide timing problems.

Implicit wait changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q7. What is explicit wait?

Explicit wait waits for a specific condition, such as visibility or clickability, before continuing.

It is the preferred wait for dynamic pages.

Explicit wait changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q8. What is fluent wait?

Fluent wait lets you configure timeout, polling interval, and ignored exceptions.

It is useful for custom wait conditions.

Fluent wait changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q9. What is a stale element reference?

A stale element reference happens when the DOM changed after WebDriver found the element.

Find the element again after the page updates.

Stale element changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q10. How do frames affect Selenium tests?

Elements inside iframes require WebDriver to switch into the frame before interacting.

Switch back to default content afterward.

Frame changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q11. How do you handle browser alerts?

Switch to the alert, then accept, dismiss, or read its text.

A modal alert blocks normal page interaction.

Alert changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q12. What is a window handle?

A window handle identifies a browser window or tab controlled by WebDriver.

Use handles when actions open new tabs or windows.

Window handle changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q13. What is the Actions API used for?

The Actions API performs advanced user gestures such as hover, drag, key chords, and pointer actions.

It is useful for menus and drag-and-drop flows.

Actions API changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Watch a deeper explanation

Video: Selenium WebDriver introduction (Automation tutorial, YouTube)

Q14. What is Page Object Model?

Page Object Model stores page locators and actions in page classes or modules.

It reduces duplication and keeps tests readable.

Page Object Model changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q15. What is Selenium Grid?

Selenium Grid runs WebDriver tests on remote browsers across machines, browser versions, and operating systems.

It supports parallel and cross-browser execution.

Selenium Grid changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Back to question list

Selenium Practical Interview Questions

Intermediate15 questions

These questions test whether you can apply the topic to real data, real code, and messy constraints.

Q16. How would you automate a login test in Selenium?

Open the login page, enter credentials, submit, wait for a logged-in signal, and assert the dashboard or session state.

Use test data and avoid checking only URL changes.

login test changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

java
WebElement email = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("email")));
email.sendKeys("qa@example.com");
driver.findElement(By.id("password")).sendKeys("secret");
driver.findElement(By.cssSelector("button[type='submit']")).click();
wait.until(ExpectedConditions.urlContains("dashboard"));

Q17. How do you choose locators?

Prefer stable test ids or ids, then accessible labels, names, CSS selectors, and only then XPath when needed.

Do not depend on generated class names.

locator strategy changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q18. How do you wait for a button to be clickable?

Use explicit wait with a clickable condition for the button locator.

This waits for the real condition instead of a fixed pause.

explicit wait changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q19. How do you test values in a dynamic table?

Wait for table data to load, locate rows by stable text or data attributes, and assert the expected row values.

Avoid row index assumptions when sorting or filtering can change order.

dynamic table changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q20. How do you interact with an element inside an iframe?

Wait for the iframe, switch into it, interact with the element, then switch back to default content.

Frame switching is a common missed step.

iframe test changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q21. How do you handle a new tab?

Store current handle, perform the action, wait for new handle, switch to it, assert, then close or switch back.

Do not assume tab order without checking handles.

new tab changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q22. How do you automate file upload?

Send the file path to an input element of type file when the app uses a normal file input.

Native OS dialogs are outside normal WebDriver control.

file upload changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q23. How do you capture failure evidence?

Take screenshot, store page source or logs, record test name, browser, URL, and step details.

Evidence makes failures reproducible.

screenshot on failure changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q24. How do you design a page object?

Keep locators and page actions in one class or module, and keep assertions in tests unless they are page-specific checks.

Do not put every workflow into one huge page object.

page object changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q25. How do you run the same Selenium test with multiple data sets?

Use the test framework's parameterization or data provider and keep test data external or generated safely.

Data setup and cleanup matter.

data-driven test changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Watch a deeper explanation

Video: Selenium WebDriver setup (Automation tutorial, YouTube)

Q26. How do you run Selenium tests in parallel?

Use isolated browser sessions, independent test data, no shared mutable state, and Grid or cloud browsers where needed.

Parallel runs expose hidden test coupling.

parallel execution changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q27. How do you run Selenium in CI?

Use headless or remote browsers, stable test data, artifacts, retries only for known infrastructure issues, and clear reports.

CI browser versions should be controlled.

CI run changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q28. How do you fix a flaky Selenium test?

Reproduce it, check waits, locators, test data, environment, browser logs, and app timing before changing the assertion.

Retries hide symptoms if root cause is not fixed.

flaky test fix changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q29. How do you test cross-browser behavior?

Run a focused suite across target browsers and versions, not every test on every browser by default.

Pick coverage based on user analytics and risk.

browser compatibility changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q30. When would you use JavaScript execution?

Use it for limited cases such as reading browser state or working around controls after confirming normal user action is not possible.

Overuse can make tests stop matching real user behavior.

JavaScript executor changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Back to question list

Selenium Advanced Scenarios

Advanced15 questions

Advanced rounds test trade-offs, failure modes, and whether the decision can hold up under production pressure.

Q31. Selenium says element is not clickable. What do you check?

Check overlays, scrolling, disabled state, wrong locator, animation, and whether the click target is ready.

Use an explicit wait for the real clickable state.

element not clickable changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q32. A stale element error appears after a filter changes results. What happened?

The DOM refreshed after the element was found.

Find the element again after the update.

stale element changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q33. A Selenium test passes locally but fails in CI. What do you inspect?

Check browser version, screen size, headless behavior, timing, test data, environment variables, and network speed.

CI is a different environment.

works locally fails CI changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q34. An absolute XPath breaks after a small UI change. What is the lesson?

Use stable, intent-based locators instead of brittle DOM paths.

Absolute XPath couples tests to layout.

absolute XPath failure changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q35. A suite uses Thread.sleep everywhere. What is the risk?

Tests become slow and still flaky because fixed sleeps do not match real page timing.

Use explicit waits.

sleep-heavy suite changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q36. Parallel tests fail because they use the same user account. What changes?

Use isolated test data or reset state safely for each test.

Shared state breaks parallelism.

shared account changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q37. A modal alert blocks the browser. What should the test do?

Switch to the alert or modal context and handle it before continuing.

Blocked UI prevents normal element actions.

modal blocks test changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q38. Grid runs are queued for too long. What do you inspect?

Check node capacity, browser mix, parallelism settings, test duration, and stuck sessions.

Grid needs capacity management.

grid capacity changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q39. A team automates every UI path with Selenium. What is the issue?

The suite may become slow, brittle, and costly to maintain.

Move lower-level checks to API and unit tests.

overautomated UI changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q40. The locator is correct but Selenium cannot find the element. What might be missing?

The element may be inside an iframe or shadow DOM context.

Switch context before searching.

hidden iframe changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q41. Drag-and-drop works manually but fails in Selenium. What do you check?

Check Actions API support, browser behavior, HTML5 implementation, and whether a lower-level test fits better.

Some gestures are harder to automate reliably.

drag fails changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q42. A Selenium test only clicks through screens and passes. What is wrong?

It does not verify business outcome.

Every test needs meaningful assertions.

test passes without assertion changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q43. Tests stop after browser update. What do you check?

Check browser driver and browser version compatibility.

Driver management matters.

driver mismatch changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q44. A checkout test fails randomly after payment submit. What do you inspect?

Check async processing, third-party sandbox, waits, test data, and whether the assertion should happen at API or database level.

UI may not be the best layer for every check.

flaky checkout changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Q45. What do you ask before approving a Selenium framework?

Ask about locator strategy, waits, page objects, test data, parallel runs, reports, CI, Grid, flake handling, and scope.

These decide maintainability.

senior review changes Selenium decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.

Back to question list

Selenium WebDriver vs Selenium Grid vs IDE

Selenium has multiple parts. Most interviews focus on WebDriver, but experienced candidates should know where Grid and IDE fit.

ToolPurposeBest useInterview warning
WebDriverAutomates browsers through codeReal UI automation suitesNeeds synchronization and locator discipline
GridRuns tests across machines and browsersParallel cross-browser runsAdds environment and capacity issues
IDERecords and plays simple browser stepsLearning or quick demosNot enough for maintainable suites
Browser driverBridge between WebDriver and browserChromeDriver, GeckoDriver, EdgeDriverVersion mismatch can break runs

Selenium answer signals

Stable automation matters more than memorizing methods.

Locators
92 signal
Waits
96 signal
Design
86 signal
Debugging
90 signal
  • Locators: stable ids, CSS, XPath trade-offs
  • Waits: explicit waits over sleeps
  • Design: page objects and reusable flows
  • Debugging: flakiness, screenshots, logs

How to Prepare for a Selenium Interview

Prepare by automating one real flow: open browser, locate elements, wait for state, perform actions, assert results, and debug a failed run.

  • Review WebDriver sessions, browser drivers, locators, waits, frames, windows, alerts, actions, JavaScript execution, and screenshots.
  • Practice Page Object Model, data-driven tests, parallel execution, and CI runs.
  • Know why Thread.sleep makes tests slow and flaky.
  • One flakiness story with root cause and fix is useful.

Selenium interview prep flow

1Open
driver and browser session
2Find
stable locator
3Wait
visible, clickable, present
4Act
click, type, switch
5Assert
state and evidence

Most rounds reward clear reasoning more than memorized phrasing.

How Strong Selenium Answers Sound

A strong Selenium answer explains why a test will be stable. Say which locator you choose, what page state you wait for, what assertion proves the behavior, and how the test reports failure. production-ready answers mention page objects, test data, parallel runs, Grid capacity, browser-driver versions, screenshots, network or console logs, and how to keep UI tests focused on high-value flows.

Use explicit waits

Wait for a meaningful browser state instead of sleeping for a fixed number of seconds.

Pick stable locators

Prefer test ids, stable ids, names, labels, and accessible roles over brittle absolute XPath.

Keep UI tests selective

Browser tests are slower and more brittle than API or unit tests, so automate critical user paths.

Debug with evidence

Screenshots, page source, browser logs, and step logs make failures actionable.

Test Yourself: Selenium Quiz

Ready to test your Selenium knowledge?

6 questions, about 4 minutes. Score 70% or higher to earn a shareable certificate.

6 questions Instant feedback Free certificate on 70%+

Frequently  Asked  Questions

What do Selenium interviews usually ask?

They ask about WebDriver, locators, waits, stale elements, frames, alerts, windows, actions, Page Object Model, Grid, CI, and flaky tests.

Do I need Java for Selenium interviews?

Many Selenium roles use Java, but Python, JavaScript, and C# are also common. Know the language listed in the job description.

What Selenium project should I discuss?

Pick a project where you automated a real user flow, fixed flaky tests, used stable locators, and ran tests in CI.

What separates experienced Selenium candidates?

Experienced candidates explain waits, locator strategy, test data, parallel execution, Grid, reports, failure evidence, and when not to use UI automation.

Practice Selenium answers before automation rounds

Hyring's AI Video Interviewer and AI Coding Interviewer help teams score test automation rounds. Use this Selenium bank to prepare clear WebDriver answers before the screen.

See Hyring AI Video Interviewer

Sources

Adithyan RKWritten by Adithyan RK
Surya N
Fact-checked by Surya N
Published on: 14 Apr 2026Last updated: 3 Jul 2026
Share: