Skip to content

Publicis Sapient Automation Testing Interview Questions & Answers

Curated interview practice questions with answers. These are practice scenarios, not a verified list of past interview questions.

About Publicis Sapient hiring for Automation Testing roles

Publicis Sapient is the digital business transformation arm of Publicis Groupe, combining strategy, product, experience design, engineering and data. Its India offices in Gurugram, Noida and Bengaluru deliver engineering and data work for global clients in retail, financial services and energy. It hires for software engineers, quality engineers, data engineers and data scientists.

For Automation Testing roles, this Publicis Sapient practice set focuses most on Selenium WebDriver (7), REST Assured (6), Core Java for Testers (5), Performance Testing with JMeter (5). It has 3 easy, 31 medium, 6 hard questions, so you can start easy and work up to the harder ones.

Company type
Consulting
Headquarters
Boston, Massachusetts, USA
Main India offices
Gurugram, Noida, Bengaluru

Publicis Sapient Automation Testing interview process

  1. Online coding assessment
  2. Technical round 1 (coding + fundamentals)
  3. Technical round 2 (design or domain)
  4. Managerial round
  5. HR round

Typical pattern based on public candidate experiences. Rounds vary by role, team and year.

Solved for Publicis SapientStart 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

How do you handle a test that is flaky only in headless mode?

Save to ▾
Show answer
Set window size explicitly, use proper waits, check animations and viewport differences, and capture screenshots and logs to find timing issues.
02

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"]
03

A runtime permission pop-up appears on first launch and breaks your Android tests. How do you handle it?

Save to ▾
Show answer
The cleanest fix is the capability appium:autoGrantPermissions set to true, which grants all permissions the app declares at install time. If you need to test the permission flow itself, handle the dialog explicitly by waiting for the Allow button using its resource-id and clicking it. Another option is granting a specific permission with adb shell pm grant before the test. Avoid blind try-catch around taps, because it hides real failures.
04

Implicit vs explicit vs fluent wait?

Save to ▾
Show answer
Implicit wait applies globally to element lookups. Explicit wait waits for a specific condition (WebDriverWait + ExpectedConditions). Fluent wait is an explicit wait with custom polling and ignored exceptions.
05

What is a quality gate in a CI/CD pipeline?

Save to ▾
Show answer
A quality gate is a rule a build must pass before moving forward, such as all smoke tests passing, code coverage above a threshold, no critical static analysis issues, or no new high-severity vulnerabilities. If the gate fails, the pipeline stops and the change is not deployed. Gates make quality an automatic decision instead of a manual check.
06

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

Cucumber says a step is undefined even though the step definition exists. How do you fix it?

Save to ▾
Show answer
Check the glue path in the runner points to the package containing the step classes. Check the step text matches exactly, including quotes and parameter types, since {string} expects quoted text. Confirm the step class is under src/test/java and compiled, the annotation import is io.cucumber.java.en, and the Cucumber versions of core, java and the runner module match. Running with dryRun shows all unmatched steps quickly.
08

What are Maven dependency scopes?

Save to ▾
Show answer
compile is the default and available everywhere. test is only for test compile and run, such as TestNG and REST Assured. provided is needed for compiling but supplied at runtime by the container. runtime is not needed to compile but needed to run, like JDBC drivers. system and import are rarer. In test projects, mark test libraries as test scope unless framework code in src/main uses them.
09

How do you automate a two-factor authentication step in a test environment?

Save to ▾
Show answer
Do not try to read SMS from a real phone. Ask developers for a test-only approach: a fixed OTP for test users, a bypass flag in non-production, or an API to fetch the latest OTP. For authenticator apps, store the test account's TOTP secret and generate codes in Java with a TOTP library. Keep production 2FA untouched and secrets in the CI credential store.
10

What is PageFactory?

Save to ▾
Show answer
A helper that initialises @FindBy elements lazily using initElements; some teams skip it in favour of plain By locators.
11

What are Java 8 streams and lambdas?

Save to ▾
Show answer
Lambdas are short anonymous functions; streams process collections declaratively with filter, map and collect, for example filtering link text from a list of elements.
12

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

What is the difference between average, median and 95th percentile response time?

Save to ▾
Show answer
Average is the sum divided by count, so a few very slow requests can distort it. Median is the middle value, meaning half the requests were faster. The 95th percentile means 95 percent of requests were faster than that value, which reflects what most users experience including slow cases. SLAs are usually written on 90th, 95th or 99th percentiles because averages hide long tails that frustrate real users.
14

How would you test an API with rate limiting?

Save to ▾
Show answer
Read the documented limit, then send requests quickly until you exceed it and assert a 429 Too Many Requests response with headers like Retry-After or remaining quota. Wait for the window to reset and confirm requests succeed again. Also check limits are per user or key as designed. Run these tests in isolation so they do not throttle the rest of the suite.
15

What is contract testing?

Save to ▾
Show answer
Verifying that a provider and consumer agree on request and response formats, using tools like Pact, to catch breaking changes early.
16

What is the difference between SOAP and REST?

Save to ▾
Show answer
SOAP is a strict XML protocol with WSDL and WS-Security; REST is a lighter architectural style using HTTP and usually JSON.
17

What are pre-processors and post-processors in JMeter?

Save to ▾
Show answer
Pre-processors run before a sampler, for example a JSR223 PreProcessor that builds a signature or timestamp, or User Parameters that set values per thread. Post-processors run after a sampler and usually extract data from the response, such as JSON Extractor, Regular Expression Extractor or Boundary Extractor, storing it as a variable for later requests. Their scope depends on where they sit in the tree, so place them as children of the right sampler.
18

What is the difference between open and closed workload models in load testing?

Save to ▾
Show answer
In a closed model a fixed number of users loop through the scenario, so when the server slows down, users wait and the arrival rate drops, which can hide problems. In an open model new requests arrive at a set rate regardless of response time, like real internet traffic, so a slow server builds a queue. JMeter thread groups are closed by default; the Open Model Thread Group or throughput timers approximate open workloads.
19

Write a declarative Jenkinsfile that runs Maven tests and publishes results.

Save to ▾
Show answer
pipeline { agent any parameters { choice(name: 'SUITE', choices: ['smoke', 'regression']) } stages { stage('Checkout') { steps { checkout scm } } stage('Test') { steps { sh "mvn clean test -DsuiteXml=${params.SUITE}.xml" } } } post { always { junit 'target/surefire-reports/*.xml' archiveArtifacts artifacts: 'target/screenshots/**', allowEmptyArchive: true } } }
20

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

Tell me about a time a CI pipeline you owned broke right before a release.

Save to ▾
Show answer
Situation: the night before release, every UI test failed in Jenkins. Task: find the cause fast and unblock the release. Action: I checked the console and saw a browser and driver version mismatch after an agent update, pinned the browser image version, reran the suite and shared a short note. Result: the release went out on time and we added image version pinning to the pipeline.
22

How do you handle alerts and pop-ups?

Save to ▾
Show answer
driver.switchTo().alert() lets you accept, dismiss, read text or send keys. Browser windows are handled with window handles.
23

How do you log requests and responses in REST Assured?

Save to ▾
Show answer
Use given().log().all() for the full request and then().log().all() for the full response. To reduce noise, use log().ifValidationFails() on both, which prints only when a test fails. For a whole suite, set RestAssured.enableLoggingOfRequestAndResponseIfValidationFails() or add RequestLoggingFilter and ResponseLoggingFilter in a shared spec. Mask tokens and passwords before logs reach CI.
24

A file download test passes locally but fails in a Grid node. How do you approach it?

Save to ▾
Show answer
The file is saved on the remote node, not the machine running the test, so the test cannot find it locally. Options are enabling Selenium Grid's managed downloads with se:downloadsEnabled and fetching the file through the Grid API, sharing a mounted volume with the container, or verifying the download by requesting the file URL with an HTTP client and checking status, size and type.
25

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

Your API token expires after 15 minutes and long REST Assured suites start failing with 401. What do you do?

Save to ▾
Show answer
Centralise token handling in an auth helper that caches the token with its expiry time and refreshes it shortly before it expires, or in a filter that catches a 401, refreshes once and retries. Do not log in before every test, as that slows the suite and may hit rate limits. Make the helper thread-safe for parallel runs.
27

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

How do you handle authentication types in REST Assured?

Save to ▾
Show answer
Basic auth uses auth().preemptive().basic(user, pass). Bearer tokens are set as a header: header("Authorization", "Bearer " + token). OAuth 2.0 can use auth().oauth2(token) after fetching the token from the token endpoint. API keys go in a header or query param. Fetch tokens once per suite or cache them with an expiry check rather than logging in before every test.
29

A stakeholder asks whether the system can handle 10,000 users. How do you plan the performance test?

Save to ▾
Show answer
First clarify what 10,000 users means: concurrent sessions, users per hour or requests per second, and which journeys they perform. Use production analytics to build the workload mix and think times, then agree on SLAs like 95th percentile under two seconds and errors under one percent. Prepare a production-like environment and data, plan baseline, load, stress and soak runs, set up monitoring, and share a report with clear limits and bottlenecks.
30

Write a docker-compose.yml that runs a Selenium hub with Chrome and Firefox nodes.

Save to ▾
Show answer
services: selenium-hub: image: selenium/hub:4.25.0 ports: - "4442:4442" - "4443:4443" - "4444:4444" chrome: image: selenium/node-chrome:4.25.0 shm_size: 2gb depends_on: - selenium-hub environment: - SE_EVENT_BUS_HOST=selenium-hub - SE_EVENT_BUS_PUBLISH_PORT=4442 - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 firefox: image: selenium/node-firefox:4.25.0 shm_size: 2gb depends_on: - selenium-hub environment: - SE_EVENT_BUS_HOST=selenium-hub - SE_EVENT_BUS_PUBLISH_PORT=4442 - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
31

A dropdown option list loads only after typing three letters. How do you automate selecting a value?

Save to ▾
Show answer
Type the text with sendKeys, wait for the suggestion list with visibilityOfAllElementsLocatedBy, then find the option whose text matches the required value and click it. Avoid selecting by index because suggestion order may change. If the list is virtualised, type more characters to narrow results. Verify the selected value in the input afterwards.
32

How would you explain to a manager why mobile automation estimates are higher than web estimates?

Save to ▾
Show answer
Situation: a manager questioned why my mobile estimate was nearly double the web one. Task: justify it with facts. Action: I listed the extra work: two platforms with separate locators, device and OS version matrix, slower sessions, app builds and signing, gestures and permissions, and device lab maintenance. I showed timings from a pilot of five tests. Result: the manager accepted a phased plan starting with Android smoke tests, and later estimates were trusted because they were data-backed.
33

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

Write Java code to start an Android Appium session using UiAutomator2Options.

Save to ▾
Show answer
UiAutomator2Options options = new UiAutomator2Options() .setPlatformName("Android") .setAutomationName("UiAutomator2") .setDeviceName("Pixel_7_API_34") .setApp(System.getProperty("user.dir") + "/apps/shop.apk") .setAutoGrantPermissions(true) .setNewCommandTimeout(Duration.ofSeconds(120)); AndroidDriver driver = new AndroidDriver( new URL("http://127.0.0.1:4723"), options); driver.manage().timeouts().implicitlyWait(Duration.ZERO); // use explicit waits in tests driver.quit();
35

How do you validate an XML response in REST Assured?

Save to ▾
Show answer
// REST Assured uses GPath for XML as well as JSON given() .accept(ContentType.XML) .when() .get("/orders/42") .then() .statusCode(200) .contentType(ContentType.XML) .body("order.@id", equalTo("42")) .body("order.items.item.size()", equalTo(3)) .body("order.status", equalTo("SHIPPED"));
36

How do you extract an auth token with JSON Extractor and use it in later JMeter requests?

Save to ▾
Show answer
Add a JSON Extractor as a child of the login sampler. Set the variable name to token, the JSON path expression to $.access_token, match number 1 and a default like TOKEN_NOT_FOUND so failures are visible. Then add an HTTP Header Manager at Thread Group level with Authorization set to Bearer ${token}. Each thread extracts and uses its own token, because JMeter variables are per thread.
37

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

What is JsonPath and how do you use it for nested JSON?

Save to ▾
Show answer
JsonPath (Groovy GPath syntax in REST Assured) navigates JSON with dot notation. For {"data":{"items":[{"price":10}]}} you use data.items[0].price. You can also filter: data.items.findAll { it.price > 5 }.name returns names of items costing more than 5. Use it inside body() assertions or via response.jsonPath().getList("data.items.name") to extract values for further checks.
39

What is a BasePage and what should it contain?

Save to ▾
Show answer
BasePage is a parent class for all page objects holding common things: the driver reference, a WebDriverWait, and helper methods such as click with wait, type, getText, waitForVisible and scrollIntoView. Child pages extend it and stay focused on page-specific locators and actions. Keep it small; if it grows into hundreds of methods, move helpers into separate utility classes using composition.
40

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.

Tips to crack the Publicis Sapient Automation Testing interview

  • Revise Java or JavaScript fundamentals, microservices and REST APIs, which are common in Publicis Sapient engineering roles.
  • Prepare to discuss design patterns and clean code, as technical rounds often go beyond simple coding.
  • Read about its SPEED model of strategy, product, experience, engineering and data for culture questions.
  • Keep a one-minute story ready for every project on your CV: problem, your part, tools, result.
  • Practise the hard questions on this page aloud; Publicis Sapient interviewers usually ask follow-ups on your first answer.

Frequently asked questions

How many rounds are there in the Publicis Sapient Automation Testing interview?

Candidates usually go through 5 stages: Online coding assessment; Technical round 1 (coding + fundamentals); Technical round 2 (design or domain); Managerial round; HR round. The exact rounds change with the role, team, location and your experience, so confirm the process with the recruiter.

Which topics should I prepare for the Publicis Sapient Automation Testing interview?

This practice set leans on Selenium WebDriver (7), REST Assured (6), Core Java for Testers (5), Performance Testing with JMeter (5). Revise those first, then practise explaining one or two of your own projects end to end, because most Publicis Sapient interviewers ask you to walk through real work.

Are these the exact questions asked at Publicis Sapient?

No. These are curated practice questions that match the skills and difficulty usually tested in consulting interviews like Publicis Sapient's. They are not a leaked or verified list of past questions.

Where does Publicis Sapient hire Automation Testing professionals in India?

Publicis Sapient has large teams in Gurugram, Noida, Bengaluru. Openings and locations change often, so check the Publicis Sapient careers page and filter by city and experience.

Automation Testing questions for similar companies