Skip to content

Automation Testing Interview Questions for Consulting Companies

40 questions weighted to the interview style of consulting companies — 6 easy, 29 medium, 5 hard.

How consulting companies interview for Automation Testing

Consulting firms look for people who can structure messy business problems and explain them simply to clients. Expect case and guesstimate questions, data interpretation, and questions on how you handled stakeholders, along with the technical skills for the role.

This set focuses on TestNG Framework (6), REST Assured (5), Page Object Model (5), Core Java for Testers (5).

Technical interview Partner or HR round Managerial round Online assessment (aptitude + technical) HR round
Solved — consulting 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

During a load test response times rise sharply. Which server-side metrics do you check?

Save to ▾
Show answer
Check CPU and memory usage of application servers, garbage collection pauses and heap usage for Java services, thread pool and connection pool saturation, database slow queries, locks and connection counts, disk I/O and network bandwidth. Also look at load balancer and cache hit rates and error logs. Correlate the timestamp of the slowdown with these graphs in an APM or monitoring tool to find which resource saturated first.
02

What is RequestSpecification in REST Assured and why use it?

Save to ▾
Show answer
RequestSpecification holds common request settings such as base URI, base path, headers, content type, authentication and filters. You build it once with RequestSpecBuilder and reuse it with given().spec(reqSpec). This removes repetition, keeps environment settings in one place and makes switching between QA and staging easy. ResponseSpecification does the same for common assertions like status code and content type.
03

What are the disadvantages of POM?

Save to ▾
Show answer
POM adds upfront design effort and extra classes, which can feel heavy for tiny projects. Poorly designed page objects become large god classes, mix assertions with actions, or use deep inheritance chains that are hard to follow. It also does not solve flaky waits or bad test data by itself. Good conventions, components and code reviews are needed to get its benefits.
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 read data from Excel or properties files in Java?

Save to ▾
Show answer
Use Apache POI for Excel and the Properties class for config files, loaded in a utility class so tests read data instead of hard-coding it.
06

An API returns 200 but your REST Assured assertion on a field fails with a null value. How do you debug it?

Save to ▾
Show answer
Log the full response with then().log().all() to see the actual body. Common causes are a wrong JSON path, such as missing a wrapper like data, the field being in an array needing an index, a different content type like XML or HTML error page, or the field name having different case. Fix the path, and add a schema check so structure changes are caught clearly.
07

Your API tests started failing with SSL handshake errors on a new test server. What do you do?

Save to ▾
Show answer
First confirm the server uses a self-signed or internal certificate. The proper fix is to import the company CA certificate into a truststore and configure REST Assured with trustStore(path, password). As a temporary measure in a test environment only, relaxedHTTPSValidation() skips checks. Never use relaxed validation against production, and raise the certificate issue with the infra team.
08

What are stubs, mocks, fakes and spies in testing?

Save to ▾
Show answer
They are test doubles that replace real dependencies. A stub returns fixed answers, such as a fake API returning a canned user. A mock also verifies how it was called, like checking a payment service received one charge. A fake is a lightweight working version, such as an in-memory database. A spy wraps a real object and records calls. Automation testers often use WireMock stubs to isolate tests from unstable services.
09

Tell me about a time you found a critical bug through automation.

Save to ▾
Show answer
Situation: during a sprint, my nightly regression showed checkout failing only for one payment option. Task: confirm if it was a test issue or a real bug. Action: I reproduced it manually, checked the API response and found a wrong tax value, then logged a clear defect with steps, logs and screenshots. Result: developers fixed it before the release and the test was added to the smoke suite.
10

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.
11

Should assertions be written inside page objects?

Save to ▾
Show answer
Generally no. Page objects should expose state and actions, such as getErrorMessage() or isLoggedIn(), and tests should make the assertions. This keeps page classes reusable across positive and negative tests and keeps the test intent visible. A small exception is a simple check that the correct page has loaded, often done in the constructor or an isAt() method.
12

How do you integrate Selenium tests with Jenkins?

Save to ▾
Show answer
Create a job or pipeline that checks out code, runs mvn test, publishes reports and triggers on commits or schedules.
13

Describe a time you improved the maintainability of an automation framework.

Save to ▾
Show answer
Situation: our suite had duplicated locators across 200 tests and each UI release broke many of them. Task: reduce maintenance effort. Action: I introduced page objects and components for the top ten pages, added data-testid attributes with the developers and wrote a short guide. Result: fixing a UI change went from half a day to under an hour, and new joiners wrote tests faster.
14

What is serialization and deserialization in REST Assured?

Save to ▾
Show answer
Serialization converts a Java object (POJO) into JSON for the request body; deserialization converts the response JSON back into a Java object. REST Assured does this automatically when Jackson or Gson is on the classpath: body(userPojo) serializes and response.as(User.class) deserializes. Using POJOs gives type safety, IDE support and cleaner assertions compared with hand-written JSON strings.
15

How do you handle a web table in Selenium?

Save to ▾
Show answer
Locate rows and columns with XPath such as //table//tr and //td, loop through them to read or click cells, or build the XPath dynamically from the row text.
16

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.
17

How do you test a responsive page in a mobile viewport using Selenium?

Save to ▾
Show answer
For layout checks you can set the window size, like driver.manage().window().setSize(new Dimension(390, 844)). For closer emulation in Chrome use mobile emulation in ChromeOptions: options.setExperimentalOption("mobileEmulation", Map.of("deviceName", "Pixel 7")), which also sets the user agent, pixel ratio and touch events. This catches responsive layout bugs quickly, but it is not a replacement for testing on real mobile browsers.
18

What is the difference between getText() and getAttribute()?

Save to ▾
Show answer
getText returns visible inner text; getAttribute returns an HTML attribute or property such as value, href or class.
19

How do you handle stakeholders who ask for performance testing only a few days before go-live?

Save to ▾
Show answer
Situation: a product team requested load testing three days before launch. Task: give useful results fast and set expectations. Action: I explained the risk, agreed on the two most critical journeys, reused API scripts and ran a short load and spike test, sharing results daily. I also proposed adding a performance stage to future sprints. Result: we found a missing database index before launch, and the next release included performance tests from the start.
20

What changed in Appium 2 compared with Appium 1?

Save to ▾
Show answer
Appium 2 split the monolithic server into a core plus separately installed drivers and plugins, managed with appium driver install and appium plugin install. It dropped the old JSON Wire Protocol in favour of W3C WebDriver only, so vendor capabilities need the appium: prefix. The default base path changed from /wd/hub to /. Old TouchAction and MultiTouchAction were removed from the Java client, so gestures use W3C Actions or mobile: commands.
21

Tell me about a time your API tests caught a breaking change before the UI tests did.

Save to ▾
Show answer
Situation: a backend team renamed a response field during a refactor. Task: our nightly REST Assured suite had to protect the mobile and web clients. Action: schema validation failed within minutes of the merge, and I shared the failing response and the contract with the developer. Result: the field was restored with a deprecation plan before the UI suite even ran, and the team added our schema tests to their pull request checks.
22

File upload tests pass locally but fail when they run on a remote Grid. Why?

Save to ▾
Show answer
sendKeys with a file path sends a path that exists on your test machine, but the browser runs on the remote node where that path does not exist. Set a LocalFileDetector on the RemoteWebDriver, using ((RemoteWebDriver) driver).setFileDetector(new LocalFileDetector()), so Selenium zips and transfers the file to the node first. Alternatively mount the test data folder into the node container. Always use absolute paths.
23

How do you pass parameters from testng.xml?

Save to ▾
Show answer
Define parameter name and value in the XML and read them with @Parameters in the test or configuration method.
24

How do you structure packages in a Selenium POM framework?

Save to ▾
Show answer
A common layout: src/main/java with pages, components, base, utils, config and drivers packages; src/test/java with tests grouped by feature, plus listeners; src/test/resources with testng.xml, config properties per environment, test data and log configuration. Keep framework code separate from tests so it can be reused, and keep each package focused on one responsibility.
25

Your code review shows a test class with 30 copy-pasted lines in every method. How do you refactor it with Java features?

Save to ▾
Show answer
Extract repeated steps into private helper methods or a page object, move common setup into @BeforeMethod, and use a DataProvider when only data differs. If the repeated code differs only in a small action, pass that action as a lambda, such as a Consumer<WebDriver>. Rerun the tests after each small refactor to confirm behaviour is unchanged.
26

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.
27

What is the difference between throw and throws?

Save to ▾
Show answer
throw actually raises an exception object inside a method; throws declares in the method signature that it may pass an exception to the caller.
28

What can testers do with Chrome DevTools Protocol support in Selenium 4?

Save to ▾
Show answer
Selenium 4 exposes CDP through the DevTools interface and the newer cross-browser BiDi APIs. Testers can capture console logs and JavaScript errors, intercept or mock network requests, emulate slow networks or geolocation, add basic authentication headers and collect performance metrics. CDP is Chromium-specific and tied to browser versions, so for long-term code prefer WebDriver BiDi features where available, and keep CDP usage behind a small helper class.
29

Tests on the Grid fail with SessionNotCreatedException saying the new session request timed out. What do you check?

Save to ▾
Show answer
It means no matching free slot appeared in time. Check the Grid UI to see whether nodes are registered and whether their capabilities match the request, such as browser name, version or platform. Compare the test thread count with total slots, since extra threads just wait in the queue. Look for stuck sessions holding slots after aborted builds. Then increase capacity, reduce threads, or raise the session request timeout.
30

What is the timeOut attribute in TestNG?

Save to ▾
Show answer
@Test(timeOut = 5000) fails the test if it runs longer than 5000 milliseconds. It can also be set at suite or test level in testng.xml. It protects pipelines from hanging tests, for example a stuck network call. It is not a performance test; use reasonable limits so slow but correct environments do not cause false failures.
31

A developer changed the UI and 40 tests failed with NoSuchElementException. How does POM help here?

Save to ▾
Show answer
Because locators live only in page classes, I check which page object methods fail, update the changed locators in those few classes, and rerun. Usually 40 failures map to two or three locators. I would also ask developers to add stable data-testid attributes and review UI changes with QA early, so future changes do not break tests unexpectedly.
32

What is method overriding and where is it useful in frameworks?

Save to ▾
Show answer
A subclass redefines a parent method. Frameworks use it to customise base behaviour, such as overriding a wait or click method in a base page class.
33

What is the difference between the normal, eager and none page load strategies in Selenium?

Save to ▾
Show answer
Page load strategy decides when navigation commands like get() return. Normal, the default, waits for the full load event including images and stylesheets. Eager returns when the DOM is ready (DOMContentLoaded), which speeds up heavy pages. None returns immediately after the initial response. With eager or none you must rely on explicit waits for the elements you need. Set it through options.setPageLoadStrategy(PageLoadStrategy.EAGER).
34

How do you run JMeter tests in a Jenkins pipeline and fail the build when an SLA is breached?

Save to ▾
Show answer
Run JMeter in non-GUI mode in a pipeline stage, ideally inside a Docker image with a pinned JMeter version, and archive the JTL and HTML report. Enforce SLAs with Duration Assertions or a JSR223 check, or parse the JTL in a script that compares 95th percentile and error rate with thresholds and exits non-zero. The Jenkins Performance plugin can also mark builds unstable or failed based on thresholds and trends.
35

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");
36

Your framework throws NullPointerException in a page object on the first action. What are the likely causes?

Save to ▾
Show answer
The driver was never initialised or was passed as null, for example a page created before setup ran or a static driver not yet assigned. With PageFactory, initElements may not have been called, so @FindBy fields are null. A config value read from a properties file may also be missing. Check the stack trace line, then fix the setup order and add null checks with clear messages.
37

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();
38

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.
39

Which reporting tools do you use?

Save to ▾
Show answer
TestNG reports, ExtentReports and Allure give charts, screenshots and logs that are easy to share with the team.
40

Why is JSR223 with Groovy preferred over BeanShell in JMeter?

Save to ▾
Show answer
JSR223 elements with Groovy compile scripts once and cache them, so they run much faster and use less CPU under load. BeanShell is interpreted on every call and becomes a bottleneck at high thread counts. Groovy also supports modern Java syntax and is the default JSR223 language. Enable caching by keeping the cache compiled script option on and passing values through vars or parameters, not by embedding ${} inside the script.

Consulting companies (13)

Consulting

Accenture

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Hyderabad, Pune +2

View questions
Consulting

Deloitte

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Hyderabad, Bengaluru, Mumbai +2

View questions
Consulting

EY

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Kolkata, Gurugram +2

View questions
Consulting

KPMG

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Gurugram, Bengaluru, Mumbai +2

View questions
Consulting

PwC

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Kolkata, Bengaluru, Mumbai +2

View questions
Consulting

Publicis Sapient

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Gurugram, Noida, Bengaluru

View questions
Consulting

Thoughtworks

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Pune, Bengaluru, Chennai +2

View questions
Consulting

ZS Associates

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Pune, Gurugram, Bengaluru

View questions
Consulting

McKinsey & Company

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Gurugram, Mumbai, Bengaluru +1

View questions
Consulting

Boston Consulting Group

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Mumbai, New Delhi, Bengaluru +1

View questions
Consulting

Bain & Company

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Gurugram, Mumbai, Bengaluru

View questions
Consulting

Grant Thornton Bharat

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Gurugram, Mumbai, Bengaluru +3

View questions
Consulting

Protiviti

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Gurugram, Mumbai, Bengaluru +1

View questions

Frequently asked questions

How are Automation Testing interviews at consulting companies different?

Consulting firms look for people who can structure messy business problems and explain them simply to clients. Expect case and guesstimate questions, data interpretation, and questions on how you handled stakeholders, along with the technical skills for the role.

Which consulting companies are covered?

This page links to 13 consulting companies, including Accenture, Deloitte, EY, KPMG, PwC, Publicis Sapient, Thoughtworks, ZS Associates. Each has its own page with rounds and a separate practice set.

What rounds should I expect?

Common rounds at these companies include: Technical interview; Partner or HR round; Managerial round; Online assessment (aptitude + technical); HR round. The exact process varies by company and role.