QAAnywhere

Remote QA & testing jobs, worldwide.

Guides

Selenium interview questions for test automation roles

By Denis Bojkovski, Test Automation Architect · Published December 2, 2026

Selenium is still in the job descriptions

Newer tools get the attention, but Selenium remains the second most requested tool in remote QA listings. On 1 December 2026, 24 of the 190 open roles on QAAnywhere named it, and 18 of those named Playwright as well. Many teams run an established Selenium suite while starting new work in another tool, and they hire people who can handle both. Of the 24, 17 descriptions mention Java, 12 Python, 15 Jenkins and 8 TestNG.

Expect questions that check whether you have maintained a real suite: waits, flaky failures, structure and running in CI.

WebDriver basics

"How does Selenium WebDriver work?"

Your test code calls a language binding, which sends commands using the W3C WebDriver protocol to a browser driver (chromedriver, geckodriver and so on), which controls the browser. Since Selenium 4.6, Selenium Manager downloads a matching driver automatically, so manual driver setup is mostly gone. Selenium 4 also added relative locators and access to Chrome DevTools features, with WebDriver BiDi as the cross-browser successor.

"What is the difference between findElement and findElements?"

findElement returns the first match and throws NoSuchElementException when there is none. findElements returns a list, which is empty when nothing matches. That makes findElements the safe way to check that something is absent.

"Which locator strategy do you prefer?"

Stable, meaningful attributes first: an id or a dedicated test attribute such as data-testid. Then short CSS selectors. XPath only when you need something CSS cannot do, such as matching by text or moving to a parent. Avoid absolute paths copied from DevTools (/html/body/div[3]/...). They break with any layout change.

Waits: the topic every interview covers

"Explain implicit, explicit and fluent waits."

  • Implicit wait: one global timeout applied to every findElement. It only waits for the element to exist, not to be visible or clickable.
  • Explicit wait: WebDriverWait with a condition, such as ExpectedConditions.elementToBeClickable(locator), for one specific situation.
  • Fluent wait: an explicit wait where you also set the polling interval and which exceptions to ignore.

Then the key point: don't mix implicit and explicit waits. The combination can produce unpredictable timeouts. Most teams set the implicit wait to zero and use explicit waits. The guide to Selenium explicit waits has examples.

"Why not Thread.sleep?"

It always waits the full time, making the suite slow. It still fails when the app takes longer than expected. Wait for a condition instead.

Common exceptions

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

The element you found earlier was removed from the page or replaced, usually because the page re-rendered after an update. The reference now points to nothing. Fix it by finding the element again right before using it, which a page object does naturally if it stores locators (By) rather than elements. Waiting for the re-render to finish helps too. Avoid catching the exception and retrying blindly.

Other exceptions to be ready to explain:

  • ElementClickInterceptedException: something such as a cookie banner, spinner or sticky header covers the element.
  • ElementNotInteractableException: the element exists but is hidden or disabled.
  • TimeoutException: the explicit wait's condition never became true.

For each, say how you would find the cause (screenshot, page source at failure) rather than how you would work around it.

Browser interactions

  • Frames: driver.switchTo().frame(...) by element, name or index, and defaultContent() to come back.
  • Windows and tabs: store the original handle, find the new one in getWindowHandles(), switch to it, and switch back when done.
  • Alerts: switchTo().alert(), then accept(), dismiss() or getText().
  • Hover, drag and drop, key combinations: the Actions class.
  • JavaScript: JavascriptExecutor for scrolling or reading values, used sparingly, because a JavaScript click skips the checks a real user click goes through.
  • Dropdowns: the Select class for native <select> elements. Custom dropdowns are ordinary clicks.

Framework design

"How do you structure a Selenium framework?"

A page object model, where page classes hold locators and user actions and the tests hold the assertions. Add a driver factory that reads the browser and environment from configuration, test data builders or API helpers for setup, and reporting with screenshots on failure. Many teams avoid PageFactory and its proxies and keep plain By locators, which are easier to debug. The guides to page objects and framework design cover the layers.

"How do you use TestNG (or JUnit 5) in the framework?"

Groups or tags for smoke and regression sets, data providers (or parameterized tests) for data-driven cases, @BeforeMethod and @AfterMethod to manage the driver, and parallel runs set in testng.xml or the JUnit configuration. Mention thread safety: in parallel runs each thread needs its own driver, usually kept in a ThreadLocal<WebDriver>.

"What about BDD with Cucumber?"

Cucumber is useful when product people actually read or write the scenarios. Otherwise it adds a layer without adding value. Only 4 of the 24 Selenium roles mentioned Cucumber or BDD, so treat it as a plus rather than a core skill. See BDD with Reqnroll and Cucumber.

Running in CI and at scale

"How do you run Selenium tests in parallel across browsers?"

Selenium Grid 4, in standalone mode for a small setup or hub and nodes for more capacity, often in Docker containers. A cloud provider is another option. The tests use RemoteWebDriver with browser options. None of the 24 descriptions mentioned Grid by name, but parallel runs come up in nearly every interview. The guide to Selenium Grid has a working setup.

"How do the tests run in your pipeline?"

Headless browsers on the CI agent or containers, a smoke set on each pull request, the full regression nightly, and screenshots, logs and a test report kept as artifacts. Jenkins came up in 15 of the 24 descriptions, so be ready to describe a Jenkinsfile stage, even a simple one.

A scenario to prepare

"Our Selenium suite takes two hours and fails randomly. You have a month. What do you do?"

  1. Measure first: which tests fail most, and which take longest.
  2. Quarantine the worst flaky tests so the suite is trusted again, and track them.
  3. Replace sleeps with explicit waits, and remove dependencies between tests.
  4. Move setup to APIs and delete UI tests that only re-check what lower-level tests cover.
  5. Run in parallel on a grid.
  6. Report progress weekly: suite time, pass rate and flaky count.

This answer shows judgement, which interviewers weigh more than any single API detail. For the general questions on test design, SQL and collaboration, see QA interview questions for remote roles.

The open roles below name Selenium.

Open remote QA roles that use Selenium

  1. Manual QA Engineer (Game Client)Playson · Europe
  2. QA/DevOps EngineerDiscord · San Francisco Bay Area or Remote (U.S.)
  3. Senior SDETSparksoft Corporation · Remote/Hybrid if local to Maryland
  4. Principal Software Engineer in TestNatera · Remote
  5. Senior SDETYipitData · India Remote

More guides