Skip to content

Automation Testing Interview Questions for Product Companies

40 questions weighted to the interview style of product companies — 2 easy, 26 medium, 12 hard.

How product companies interview for Automation Testing

Product companies run deeper interviews with fewer, harder questions. Expect hands-on problem solving, scenario and design questions, follow-ups that test your depth, and a round on ownership and impact. Your projects should show measurable results.

This set focuses on TestNG Framework (8), Appium Mobile Automation (5), Selenium WebDriver (5), API Testing and CI/CD (5).

Hiring manager round Online coding assessment Technical round 1 (DSA) HR round Technical round 1
Solved — product companiesStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

What is the Maven Surefire plugin and how do you configure it for TestNG?

Save to ▾
Show answer
Surefire runs tests during the test phase. For TestNG, configure suiteXmlFiles with the path to testng.xml, so mvn test runs that suite. You can pass system properties, set parallel and threadCount, and control reports. Make the suite file a property like ${suiteXml} so CI can choose smoke.xml or regression.xml with -DsuiteXml=smoke.xml.
02

What is data-driven testing?

Save to ▾
Show answer
Running the same test logic with multiple data sets from Excel, CSV, JSON or a database, so coverage increases without duplicating code.
03

Write Appium code to scroll to an element by its text using UiScrollable on Android.

Save to ▾
Show answer
// Scrolls the first scrollable container until the text is visible String selector = "new UiScrollable(new UiSelector().scrollable(true))" + ".scrollIntoView(new UiSelector().text(\"Order History\"))"; WebElement item = driver.findElement(AppiumBy.androidUIAutomator(selector)); item.click();
04

How does Appium automate iOS apps and what setup is required?

Save to ▾
Show answer
Appium uses the XCUITest driver, which builds and installs WebDriverAgent on the simulator or device. WebDriverAgent is a small XCTest-based server that receives commands and drives the UI. You need a Mac with Xcode, the iOS SDK and command line tools. For real devices you also need a valid Apple developer team, provisioning profile and signed WebDriverAgent. Most iOS setup failures come from signing problems or Xcode and iOS version mismatches.
05

How do you test an application that requires login on every test without slowing the suite?

Save to ▾
Show answer
Log in once through the API, capture the session cookie or token, and inject it into the browser with driver.manage().addCookie() after opening the domain, or set local storage with JavaScript. Then navigate directly to the page under test. Keep one real UI login test to cover the login page itself. This often saves several seconds per test.
06

Your UI tests run noticeably slower on the Grid than on your laptop. How do you find the cause?

Save to ▾
Show answer
Every command now travels over the network, so chatty code with many findElement calls or getText in loops suffers most. Check latency between test runner and Grid, ideally keeping them in the same network or region. Check node resources: overloaded CPU or many sessions per container slow browsers. Video recording and VNC add overhead. Reduce round trips by batching checks, using JavaScript for bulk reads and avoiding implicit waits combined with explicit ones.
07

How have you handled disagreement with a developer about whether something is a bug?

Save to ▾
Show answer
Situation: a developer said a rounding difference in invoice totals was expected. Task: resolve it without friction. Action: I checked the requirement, found it specified rounding per line, and brought the document and a test case with expected values to a quick call with the BA. Result: the BA confirmed it was a bug, it was fixed, and we added the rule to the acceptance criteria.
08

Your recorded JMeter script fails with 403 on every request after login. What is the likely cause?

Save to ▾
Show answer
The script is probably replaying hard-coded dynamic values, such as a CSRF token, session cookie or auth header captured during recording. The server rejects them because they belong to the old session. Add an HTTP Cookie Manager so cookies are handled per thread, extract the CSRF or bearer token from the login response with an extractor, and replace the recorded value with the variable. Verify with View Results Tree on one thread.
09

What is the difference between parallel="methods", "classes" and "tests" in testng.xml?

Save to ▾
Show answer
methods runs each @Test method in its own thread, giving the most parallelism but requiring fully independent tests and thread-safe drivers. classes runs all methods of one class in the same thread, with different classes in parallel. tests runs each <test> tag in parallel, often used to run different browsers. instances is also available for factory instances. thread-count sets the pool size.
10

What are access modifiers in Java?

Save to ▾
Show answer
public (everywhere), protected (package and subclasses), default (package) and private (same class), used to control visibility of test utilities.
11

How do you run tests in parallel?

Save to ▾
Show answer
Use TestNG parallel="methods | classes | tests" with thread-count, keep WebDriver in a ThreadLocal, and use Selenium Grid or a cloud grid for multiple browsers.
12

What is the Optional class in Java and where is it useful in test code?

Save to ▾
Show answer
Optional is a container that may or may not hold a value, introduced in Java 8 to avoid returning null. In test code it suits lookups that can legitimately find nothing, such as finding a row in a table or reading an optional config key. Callers use orElse, orElseThrow or ifPresent instead of null checks. For example, findRowByName(name).orElseThrow(() -> new AssertionError(name + " not found")) gives a clear failure message.
13

How do you create a custom parameter type in Cucumber?

Save to ▾
Show answer
Annotate a method with @ParameterType, giving a regex and returning a domain object. For example @ParameterType("admin|manager|viewer") public Role role(String name) { return Role.valueOf(name.toUpperCase()); } lets you write steps like "I log in as {role}". It keeps conversion logic in one place, makes steps type-safe and gives clearer errors when an invalid value is used.
14

Write Java code to create a RemoteWebDriver for a Selenium Grid using ChromeOptions.

Save to ▾
Show answer
String gridUrl = System.getProperty("grid.url", "http://localhost:4444"); ChromeOptions options = new ChromeOptions(); options.addArguments("--window-size=1920,1080"); options.setCapability("se:name", "Login smoke test"); WebDriver driver = new RemoteWebDriver(new URL(gridUrl), options); try { driver.get("https://app.test/login"); } finally { driver.quit(); }
15

Your UI regression suite has 15 percent flaky failures. How would you bring it under control?

Save to ▾
Show answer
Measure flakiness per test over many runs and fix the worst first. Typical fixes are replacing sleeps with explicit waits, creating independent test data via API, avoiding shared logins, using stable locators, isolating parallel drivers and stubbing unstable third parties. Quarantine known flaky tests into a separate job so they do not block releases, and set a target like under 2 percent.
16

How do you run Cucumber scenarios in parallel?

Save to ▾
Show answer
With TestNG, extend AbstractTestNGCucumberTests and override scenarios() with @DataProvider(parallel = true), then set data-provider-thread-count. With JUnit 5, set cucumber.execution.parallel.enabled=true in junit-platform.properties. Each scenario must own its WebDriver, usually through a ThreadLocal or a per-scenario DI context, and test data must not clash. Parallelism is per scenario, not per step.
17

How do you switch between native and webview contexts in a hybrid app?

Save to ▾
Show answer
// Requires the webview to be debuggable in the app build Set<String> contexts = driver.getContextHandles(); for (String ctx : contexts) { if (ctx.startsWith("WEBVIEW")) { driver.context(ctx); break; } } driver.findElement(By.cssSelector("#email")).sendKeys("qa@test.com"); // back to native controls driver.context("NATIVE_APP");
18

What is Dynamic Grid in Selenium 4?

Save to ▾
Show answer
In Dynamic Grid the node does not run browsers itself. It is configured with a Docker socket and a list of browser images, and for each new session it starts a fresh browser container, runs the test and then removes the container. Every test gets a clean browser, and capacity grows without pre-starting many nodes. It can also record video per session. The trade-off is container start-up time for each session.
19

Tell me about a time you reduced the run time of a test suite significantly.

Save to ▾
Show answer
Situation: our TestNG regression took three hours, so it only ran nightly. Task: get it under forty minutes to run on every merge. Action: I profiled slow tests, replaced UI login with an API token, made the driver ThreadLocal and enabled parallel classes, moved data setup to APIs and removed duplicate tests. Result: the suite ran in thirty-five minutes on four threads, and defects were caught on the same day they were introduced.
20

How do you handle a website that uses CAPTCHA?

Save to ▾
Show answer
Do not automate it; ask for a test environment where CAPTCHA is disabled or use test keys, or a bypass token agreed with developers.
21

Write a BasePage helper that clicks an element after waiting for it to be clickable.

Save to ▾
Show answer
public abstract class BasePage { protected final WebDriver driver; protected final WebDriverWait wait; protected BasePage(WebDriver driver) { this.driver = driver; this.wait = new WebDriverWait(driver, Duration.ofSeconds(10)); } protected void click(By locator) { wait.until(ExpectedConditions.elementToBeClickable(locator)).click(); } }
22

Write a TestNG listener that logs test start and failure.

Save to ▾
Show answer
public class LogListener implements ITestListener { @Override public void onTestStart(ITestResult r) { System.out.println("START: " + r.getMethod().getMethodName()); } @Override public void onTestFailure(ITestResult r) { System.out.println("FAIL: " + r.getName() + " - " + r.getThrowable()); } } // register with @Listeners(LogListener.class) or <listeners> in testng.xml
23

How do you attach a screenshot to the Cucumber report when a scenario fails?

Save to ▾
Show answer
@After public void afterScenario(Scenario scenario) { if (scenario.isFailed()) { byte[] shot = ((TakesScreenshot) driver) .getScreenshotAs(OutputType.BYTES); scenario.attach(shot, "image/png", scenario.getName()); } driver.quit(); }
24

Write Appium Java code to perform a vertical swipe using W3C Actions.

Save to ▾
Show answer
// Swipe up from 80% to 20% of the screen height Dimension size = driver.manage().window().getSize(); int x = size.width / 2; int startY = (int) (size.height * 0.8); int endY = (int) (size.height * 0.2); PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "finger"); Sequence swipe = new Sequence(finger, 1); swipe.addAction(finger.createPointerMove(Duration.ZERO, PointerInput.Origin.viewport(), x, startY)); swipe.addAction(finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg())); swipe.addAction(finger.createPointerMove(Duration.ofMillis(600), PointerInput.Origin.viewport(), x, endY)); swipe.addAction(finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg())); driver.perform(List.of(swipe));
25

How do you mock an external API in automation tests?

Save to ▾
Show answer
Use a tool such as WireMock or MockServer to run a stub server that returns predefined responses for given requests. Point the application or tests to the stub with configuration. This lets you test error codes, timeouts and edge cases that are hard to trigger on the real service, and keeps tests stable when the third party is down. Still keep a few tests against the real integration.
26

Write a Dockerfile that runs a Maven and TestNG test suite.

Save to ▾
Show answer
FROM maven:3.9-eclipse-temurin-21 WORKDIR /app # cache dependencies first for faster rebuilds COPY pom.xml . RUN mvn -q dependency:go-offline COPY src ./src COPY testng.xml . ENV GRID_URL=http://selenium-hub:4444 CMD ["sh", "-c", "mvn test -Dgrid.url=$GRID_URL -Dsurefire.suiteXmlFiles=testng.xml"]
27

Tell me about a time a BDD conversation clarified a requirement before development started.

Save to ▾
Show answer
Situation: a story said users get a refund if an order is cancelled early. Task: write scenarios with the product owner and developer. Action: while writing examples I asked what early meant and whether shipped orders counted. The three of us found the story had no time limit and no rule for partial shipments, and we wrote four concrete scenarios. Result: the rules were fixed before coding, avoiding a rework that had happened in a previous sprint.
28

Selenium's driver version suddenly mismatches the browser version on agents. How do you prevent this?

Save to ▾
Show answer
Use Selenium Manager, built into Selenium 4.6 and later, which resolves the right driver automatically, so you do not commit driver binaries. In CI, pin browser versions using Docker images or browser options so all agents match. Avoid auto-updating browsers on test agents. Log the browser and driver versions at the start of each run to diagnose quickly.
29

Describe a time you convinced developers to fix a problem found by automation.

Save to ▾
Show answer
Situation: an API test kept failing intermittently and developers called it a test issue. Task: prove or disprove it. Action: I collected logs from ten failures, showed the same race condition in the order service with request IDs, and reproduced it with a small parallel script. Result: developers fixed a real concurrency bug before it reached customers, and trust in the suite improved.
30

How do you publish Allure or Extent reports from Jenkins?

Save to ▾
Show answer
For Allure, install the Allure Jenkins plugin, configure the commandline tool, and add allure results: [[path: 'target/allure-results']] in the post always block. For Extent, archive the HTML file and use the HTML Publisher plugin to show it as a build link. Keep report history per build and share the link in failure notifications.
31

How do you retry failed tests in TestNG?

Save to ▾
Show answer
Implement IRetryAnalyzer with a retry count and attach it through the test annotation or a listener to rerun flaky tests.
32

In a hybrid Android app, driver.getContextHandles() returns only NATIVE_APP. Why?

Save to ▾
Show answer
The webview is probably not debuggable. Android only exposes a webview to automation when the app calls WebView.setWebContentsDebuggingEnabled(true), which developers usually enable only in debug builds, so ask for a debug or test build. Also wait until the webview screen is actually loaded before reading contexts. If the app uses Chrome custom tabs, that is a separate Chrome process, not a webview. Finally check that a compatible Chromedriver is available to Appium.
33

Which tests should run at each stage of a CI/CD pipeline?

Save to ▾
Show answer
On every commit or pull request: unit tests, static checks and a fast API and UI smoke suite. After deploying to a test environment: broader API and integration tests. Nightly: full UI regression across browsers. Before or after production release: a short production-safe smoke and monitoring checks. Faster feedback first, heavier tests later.
34

How do you test an API that depends on another service that is down?

Save to ▾
Show answer
Use mocks or stubs such as WireMock to simulate the dependency and test your service in isolation.
35

What is method chaining in Page Object Model?

Save to ▾
Show answer
Method chaining means page methods return a page object, either this or the next page, so calls can be linked: loginPage.enterUser("asha").enterPassword("x").submit().openOrders(). Returning the next page models navigation and makes tests read like a user journey. Be careful when an action can lead to different pages; return the correct type or provide separate methods for success and failure.
36

Response times are fine with 50 users, but at 300 users the error rate jumps to 20 percent. How do you analyse it?

Save to ▾
Show answer
Look at which requests fail and their error codes: 503 or 504 suggest overloaded servers or gateways, connection refused points to exhausted connection pools or ports. Find the user count where errors start by running a stepped ramp-up. Correlate with server metrics such as CPU, thread pools, database connections and GC. Confirm the load generator itself was not overloaded. Report the saturation point and the bottleneck with evidence, not just the error percentage.
37

What does dependsOnMethods do?

Save to ▾
Show answer
It makes a test run only after specified tests pass, otherwise it is skipped. Use sparingly as it creates coupled tests.
38

A click works locally but throws ElementClickInterceptedException in CI. How do you fix it?

Save to ▾
Show answer
Another element, such as a cookie banner, loader overlay or sticky header, covers the target. In CI the window is often smaller, so the layout differs. Set a fixed window size, wait for the overlay to disappear with invisibilityOfElementLocated, close banners in setup and scroll the element into view. Use a JavaScript click only as a last resort, since it bypasses real user behaviour.
39

How does the DataProvider annotation work?

Save to ▾
Show answer
A method annotated with @DataProvider returns a 2D object array and the test with dataProvider = "name" runs once per row.
40

Tests pass locally but fail on Jenkins. Why?

Save to ▾
Show answer
Headless mode or screen resolution, timing issues, environment data, missing dependencies, browser–driver version mismatch or parallel conflicts. Check logs and failure screenshots and make waits robust.

Product companies (31)

Product

Amazon

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Hyderabad, Chennai +2

View questions
Product

Google

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Hyderabad, Gurugram +2

View questions
Product

Meta

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Gurugram, Bengaluru, Hyderabad +1

View questions
Product

Microsoft

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Hyderabad, Bengaluru, Noida +2

View questions
Product

Adobe

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Noida, Bengaluru, Gurugram

View questions
Product

Oracle

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Hyderabad, Noida +2

View questions
Product

Salesforce

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Hyderabad, Bengaluru, Mumbai +1

View questions
Product

ServiceNow

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Hyderabad, Bengaluru

View questions
Product

Atlassian

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru

View questions
Product

LinkedIn

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Gurugram, Mumbai

View questions
Product

Uber

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Hyderabad, Gurugram

View questions
Product

Ola

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru

View questions
Product

Freshworks

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Chennai, Bengaluru, Hyderabad

View questions
Product

Zoho

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Chennai, Tenkasi

View questions
Product

BrowserStack

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Mumbai, Bengaluru

View questions
Product

Dream11

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Mumbai

View questions
Product

SAP

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Gurugram, Pune +1

View questions
Product

Sprinklr

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Gurugram, Bengaluru

View questions
Product

Postman

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru

View questions
Product

InMobi

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru

View questions
Product

Chargebee

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Chennai, Bengaluru

View questions
Product

Druva

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Pune

View questions
Product

ThoughtSpot

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru

View questions
Product

Expedia Group

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Gurugram, Bengaluru

View questions
Product

Autodesk

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Pune

View questions
Product

Red Hat

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Pune, Bengaluru

View questions
Product

Nutanix

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Pune

View questions
Product

Workday

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Pune

View questions
Product

NetApp

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru

View questions
Product

Urban Company

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Gurugram

View questions
Product

Rapido

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru

View questions

Frequently asked questions

How are Automation Testing interviews at product companies different?

Product companies run deeper interviews with fewer, harder questions. Expect hands-on problem solving, scenario and design questions, follow-ups that test your depth, and a round on ownership and impact. Your projects should show measurable results.

Which product companies are covered?

This page links to 31 product companies, including Amazon, Google, Meta, Microsoft, Adobe, Oracle, Salesforce, ServiceNow. Each has its own page with rounds and a separate practice set.

What rounds should I expect?

Common rounds at these companies include: Hiring manager round; Online coding assessment; Technical round 1 (DSA); HR round; Technical round 1. The exact process varies by company and role.