QA Automation Tester · interview prep

QA Automation Tester interview questions and answers (2026)

The QA Automation Tester questions candidates are most often asked, covering test design, Selenium, Playwright, API testing, test frameworks. Each answer is short enough to say out loud. For the full process, scenario and HR questions and a 48-hour plan, open the guide for your company below.

Preparing for a QA Automation Tester interview? Rehearse these questions with Interview AI Helper: ask any question and get a suggested answer in seconds, written from your own resume.

Free 5-minute demo

QA Automation Tester interview guides by company

Most asked QA Automation Tester questions

How would you locate a button when its class attribute changes based on theme?

Use a stable attribute such as the button text with By.xpath("//button[normalize-space()='…']") or combine multiple attributes in a CSS selector like button[data-action='submit'][type='button']. If the theme adds a prefix, use a contains match: By.cssSelector("button[class*='submit']"). This reduces reliance on volatile class names.

From the Accenture QA Automation Tester guide

How do you locate an element whose id changes each session but contains a stable prefix?

Use a CSS selector with the prefix and a wildcard, for example cssSelector('[id^=user_']'). This matches any id that starts with the given string, avoiding reliance on the full dynamic value.

From the Amazon QA Automation Tester guide

How would you locate a button whose text changes after a page reload?

Use a stable attribute like data-test-id if available, otherwise locate by XPath that matches the button tag and partial text, e.g., //button[contains(.,'Submit')]. Combine with WebDriverWait for visibility to handle the reload. This avoids relying on volatile text that may vary with locale.

From the Infosys QA Automation Tester guide

How do you locate an element with Selenium that has dynamic IDs?

When IDs change each run, locate the element by a stable attribute such as name, class or data test id. Use a relative XPath like //button[contains(@class,'submit')] or a CSS selector with a partial attribute: css=button[data-test-id*='login']. Avoid absolute paths and store the locator in a page object so it can be updated in one place. This keeps the script stable despite ID variations.

From the TCS QA Automation Tester guide

Explain the difference between driver.quit() and driver.close() in Selenium.

driver.close() shuts the current browser window, leaving the session alive if other windows remain open. driver.quit() ends the entire WebDriver session, closing all windows and releasing resources. Use close() when you need to switch back to another window, and quit() at the end of the test suite to ensure clean teardown.

From the Accenture QA Automation Tester guide

What is the purpose of @DataProvider in TestNG and how do you use it?

@DataProvider supplies test data to a method. Define a method returning Object[][], annotate it with @DataProvider(name="dp"), then reference it in the test with @Test(dataProvider="dp"). Each row runs as a separate test iteration.

From the Amazon QA Automation Tester guide

Explain the difference between driver.navigate().back() and driver.get(url).

navigate().back() moves the browser history one step back, preserving the current session state, while get(url) loads a new page and replaces the current document. Use back() for typical user navigation, get() when you need to start from a known URL or reset session data.

From the Infosys QA Automation Tester guide

What is the difference between implicit and explicit waits in Selenium?

An implicit wait tells Selenium to poll the DOM for a set time when any element is not immediately found, applying globally. An explicit wait targets a specific condition, such as visibility of a particular element, and is applied only where needed. Implicit waits can hide timing issues, while explicit waits give finer control and reduce unnecessary delays, leading to more reliable scripts.

From the TCS QA Automation Tester guide

What is a data‑driven test and how do you implement it in TestNG?

A data‑driven test runs the same test logic with multiple data sets. In TestNG, define a @DataProvider method that returns Object[][] and reference it in the test with @Test(dataProvider="name"). Each row supplies parameters such as username and password, allowing the same test method to execute repeatedly with different inputs.

From the Accenture QA Automation Tester guide

Explain how to use Playwright’s expect API for assertions on a network response.

After triggering the request, call page.waitForResponse(url => url.includes('api')) to capture the response, then use expect(response).toBeOK() and expect(await response.json()).toContainKey('status') for validation.

From the Amazon QA Automation Tester guide

What is a keyword‑driven test and how can you implement it with TestNG?

A keyword‑driven test separates test steps (keywords) from code. Store actions like CLICK, ENTER_TEXT in an external sheet, read them in a TestNG data provider, and map each keyword to a method in a utility class. This makes tests readable for non‑technical stakeholders and reusable across multiple test cases.

From the Infosys QA Automation Tester guide

How do you handle multiple browser windows or tabs in Selenium?

First capture the current window handle with driver.getWindowHandle(). After opening a new window or tab, retrieve all handles using driver.getWindowHandles(). Switch to the desired window by iterating over the set and calling driver.switchTo().window(handle) until the title or URL matches the expected value. Perform actions, then switch back to the original handle when finished.

From the TCS QA Automation Tester guide

QA Automation Tester interview coming up?

Practise these QA Automation Tester questions out loud and get suggested answers in real time, based on your own resume. Free 5-minute demo, no subscription.

Try the free demo
← All interview question guides