Skip to content
Live on Product Hunt

We just launched BrainUp on Product Hunt. Thanks for coming over!

BrainUp
  • Templates
  • Resume Guides
  • Blog
  • Pricing
  • Contact
Log inBuild Resume
  • Templates
  • Resume Guides
  • Blog
  • Pricing
  • Contact
  • Log in
Build My Resume — Free
BrainUp

Build your resume. Then build your advantage. The career productivity toolkit for your whole job search.

Products

  • Free Resume Builder
  • Cover Letter Builder
  • LinkedIn Optimizer (Premium)
  • AI Interview Prep (Premium)
  • Job Tracker (Premium)

Resources

  • Resume Templates
  • Resume Guides
  • Career Blog

Company

  • Pricing
  • Contact us

Legal

  • Terms
  • Privacy
  • Cookies

© 2026 BrainUp. All rights reserved. ·

BrainUp is a career productivity tool, not a recruitment agency. We help you prepare — we don't guarantee interviews, job offers or ATS outcomes.

BrainUp

  1. Home
  2. Selenium Interview Questions

Selenium interview prep

Selenium Interview Questions: WebDriver, Waits and Frameworks

Selenium interviews test locators, explicit vs implicit waits, handling frames, windows and alerts, the Page Object Model, TestNG or JUnit features, Selenium Grid, and how you design and stabilise a framework. Expect to write a short WebDriver script.

Practise with AI Interview PrepSee automation testing resume
  • 15 questions answered
  • Java examples
  • Framework design
  • 1-5 years level

Sample answers

Show framework thinking, not just commands.

Senior interviewers care about maintainability and stability, not just whether you know findElement.

Model answers for 4 Selenium questions

Typical round: concepts, framework walkthrough, a live script

Q: Implicit vs explicit wait? A: An implicit wait sets a global timeout for finding elements. An explicit wait, using WebDriverWait with ExpectedConditions, waits for a specific condition like elementToBeClickable. Prefer explicit waits and avoid mixing them with a long implicit wait, which can cause unpredictable delays.

Q: How did you design your framework? A: Java with Selenium 4 and TestNG, Page Object Model for pages, a driver factory with ThreadLocal for parallel runs, config files per environment, test data from Excel or JSON, Extent reports with screenshots on failure, and Jenkins running suites nightly.

Q: How do you handle a StaleElementReferenceException? A: It means the DOM changed after you found the element. Re-locate the element after the page updates, wait for the expected state with an explicit wait, and avoid caching elements across page reloads.

Q: How do you switch to a new window? A: Store the current handle with getWindowHandle(), loop through getWindowHandles(), switch to the one that differs with switchTo().window(), and switch back when done.

What interviewers check

Built for scanners, humans and hiring intent.

  • Locator strategy

    Choosing stable IDs and CSS selectors over brittle absolute XPath shows practical experience.

  • Synchronisation

    Explicit waits and handling dynamic elements are where most flaky tests come from.

  • Framework design

    POM, driver management, reporting and CI integration show you can build a suite, not just scripts.

  • Execution at scale

    Parallel runs with TestNG and Selenium Grid matter for large regression suites.

Examples

Copy the structure, not the wording.

These examples show shape and specificity. Add your own facts, metrics, tools and outcomes.

WebDriver basics

  • What are the components of Selenium?
  • What locators does Selenium support?
  • findElement vs findElements?
  • What's new in Selenium 4?
  • What is the Page Object Model?

Framework questions

  • How do you run tests in parallel with TestNG?
  • How do you read test data from Excel?
  • How do you take screenshots on failure?
  • What are TestNG annotations and their order?
  • How do you integrate tests with Jenkins?

Hands-on tasks

  • Automate a login and verify the dashboard title.
  • Select a value from a dropdown.
  • Handle a JavaScript alert.
  • Switch into an iframe and back.
  • Perform a mouse hover with Actions.

Actionable tips

Small edits that lift response rates.

Run through these before every application.

  1. 1Know Selenium 4Relative locators, built-in driver management and the W3C protocol show you're current.
  2. 2Prepare a framework diagramBe able to explain layers, data flow and reporting in two minutes.
  3. 3Have a flaky-test storyExplain how you found the cause and stabilised it, not just added retries.
  4. 4Practise Java basicsCollections, OOP and exceptions are often tested alongside Selenium.
  5. 5Rehearse aloudBrainUp AI Interview Prep runs QA automation mock interviews with feedback.

FAQ

Common questions, direct answers.

What is Selenium?

Selenium is an open-source suite for automating web browsers, mainly used for testing. Its core is WebDriver, which controls browsers through a standard protocol.

What are the components of Selenium?

Selenium WebDriver for browser automation, Selenium IDE for record and playback, and Selenium Grid for running tests in parallel across machines and browsers.

Which locators does Selenium support?

ID, name, class name, tag name, link text, partial link text, CSS selector and XPath, plus relative locators in Selenium 4.

What is the difference between findElement and findElements?

findElement returns the first matching element or throws NoSuchElementException. findElements returns a list, which is empty if nothing matches.

What is the difference between implicit and explicit wait?

Implicit wait applies a global timeout to element searches. Explicit wait waits for a specific condition on a specific element and is more precise.

What is a fluent wait?

A configurable explicit wait that sets the maximum time, polling frequency and exceptions to ignore while waiting for a condition.

What is the Page Object Model?

A design pattern where each page has a class holding its locators and actions, so tests call readable methods and locator changes happen in one place.

How do you handle frames in Selenium?

Switch with driver.switchTo().frame() using index, name or element, perform actions, then return with switchTo().defaultContent().

How do you handle alerts?

Switch to the alert with driver.switchTo().alert(), then call accept(), dismiss(), getText() or sendKeys() as needed. Wait for it with ExpectedConditions.alertIsPresent() first.

How do you handle dropdowns?

For HTML select elements, use the Select class with selectByVisibleText, selectByValue or selectByIndex. Custom dropdowns are handled with clicks and waits.

What is Selenium Grid?

Grid runs tests on multiple machines and browsers in parallel through a hub and nodes, reducing total execution time.

What are TestNG annotations?

Annotations like @BeforeSuite, @BeforeClass, @BeforeMethod, @Test, @AfterMethod and @AfterClass control setup, test execution and teardown order.

What causes StaleElementReferenceException?

The element reference is no longer attached to the DOM because the page changed. Re-locate the element after the update.

Selenium vs Playwright: which is better?

Selenium has broad language support and a mature ecosystem. Playwright offers built-in auto-waiting, tracing and faster parallel runs. Many teams use either depending on stack and history.

How should I prepare for a Selenium interview?

Build a small POM framework with TestNG, waits, reporting and CI, practise common scripts, and be ready to explain how you made tests stable.

Related guides

Keep improving your application.

  • Automation Testing ResumePresent your framework and results on your resume.View automation resume →
  • Playwright Interview QuestionsThe newer framework many teams now ask about.See Playwright questions →
  • Manual Testing Interview QuestionsQA fundamentals asked alongside automation.See manual testing questions →

Practise Selenium interview answers

BrainUp AI Interview Prep runs automation testing mock interviews.

Start interview practiceBrowse templates

The resume builder and PDF downloads are free. AI tools are part of BrainUp Premium.