Skip to content

Automation Testing Interview Questions in Gurgaon

36 practice questions with answers for Automation Testing interviews in Gurgaon.

Automation Testing jobs in Gurgaon

Gurgaon (Gurugram) is home to many multinational, consulting, fintech and consumer-internet offices. Interviews often expect strong business understanding along with technical skills, especially for analytics and product-facing roles.

Below are 36 questions that match the mix of service, product and domain employers hiring automation testers in Gurgaon.

Solved for GurgaonStart 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 an element inside a shadow DOM in Selenium 4?

Save to ▾
Show answer
Find the shadow host element, then call getShadowRoot() to get a SearchContext, and search inside it with CSS selectors: driver.findElement(By.cssSelector("my-app")).getShadowRoot().findElement(By.cssSelector("#submit")). XPath does not work inside shadow roots. For nested shadow roots, repeat the step for each host. Closed shadow roots cannot be accessed this way.
02

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

A test reading a properties file works in the IDE but fails in Jenkins with FileNotFoundException. Why?

Save to ▾
Show answer
The file path is probably hard-coded or relative to the IDE working directory, or uses Windows backslashes while Jenkins runs on Linux. Load the file from the classpath with getClass().getClassLoader().getResourceAsStream("config.properties") and keep it in src/test/resources, or build paths with Paths.get. Also check the file is committed to Git and not ignored.
04

What are Java collections and which ones do testers use most?

Save to ▾
Show answer
ArrayList and LinkedList for lists, HashSet for unique values, HashMap for key-value test data, and Iterator for traversing them, for example collecting web elements in a list.
05

A test configuration value has to be the same for the whole run and accessed from many classes. How do you implement it?

Save to ▾
Show answer
Create a ConfigReader that loads properties once, using a singleton or a static holder initialised lazily in a thread-safe way, and exposes typed getters like getInt("timeout"). Let system properties and environment variables override file values so CI can change them. Keep it read-only after loading so parallel threads cannot change settings mid-run.
06

What is the difference between a page object and a utility class in a test framework?

Save to ▾
Show answer
A page object models one screen or component: its locators and the user actions possible there, such as LoginPage.loginAs. A utility class holds generic helpers not tied to any page, such as reading config, generating test data, date formatting or taking screenshots. Mixing them makes page objects bloated and utilities dependent on the UI. Keep page objects in a pages package and helpers in a utils package.
07

What is the Fluent Page Object pattern?

Save to ▾
Show answer
Fluent page objects return objects from every action so a test reads like a sentence, for example new SearchPage(driver).searchFor("phone").filterByBrand("X").sortByPrice().firstResult(). It improves readability and models navigation. The risk is long chains that hide failures, so keep chains to a single journey and use clear method names that show which page you end on.
08

After aborted Jenkins builds, Grid slots stay busy and new tests wait. How do you handle it?

Save to ▾
Show answer
When a build is killed, driver.quit() never runs, so sessions stay open until the node notices. Set a sensible session timeout on nodes, such as SE_NODE_SESSION_TIMEOUT of 300 seconds, so idle sessions are cleaned up. Always call quit in an @AfterMethod with alwaysRun or a finally block. In CI, bring the Compose Grid up per build and tear it down in a post always step, so each build gets a fresh Grid.
09

What is the difference between Comparable and Comparator in Java?

Save to ▾
Show answer
Comparable defines the natural order inside the class (compareTo); Comparator defines custom orders externally (compare), useful for sorting test data in several ways.
10

What is git cherry-pick?

Save to ▾
Show answer
git cherry-pick <commit> applies the changes of one specific commit onto your current branch, creating a new commit. It is useful when a fix on one branch, such as a locator fix on develop, is urgently needed on a release branch without merging everything else. Overuse creates duplicate commits and confusing history, so prefer normal merges when possible.
11

What does alwaysRun = true do in TestNG?

Save to ▾
Show answer
On a configuration method like @AfterMethod(alwaysRun = true), it makes the method run even when tests fail or are skipped, or when groups filter would exclude it. It is essential for cleanup such as driver.quit(). On a test with dependsOnMethods, alwaysRun = true runs it even if the dependency failed. Missing alwaysRun on teardown is a common cause of leftover browsers in CI.
12

What are generics in Java and how do they help in a test framework?

Save to ▾
Show answer
Generics let classes and methods work with a type parameter while keeping compile-time type safety, such as List<String> or a method <T> T readJson(String path, Class<T> type). In a framework they let you write one reusable helper for many types, for example a generic API client that deserializes responses into any POJO, or a BasePage method that returns the correct page type for chaining. They remove casts and catch type errors at compile time.
13

Tell me about a time you set up test infrastructure that other teams started using.

Save to ▾
Show answer
Situation: three product teams each kept their own unstable Grid VMs. Task: provide one reliable shared Grid. Action: I set up a Docker-based Grid with pinned images, health checks, video for failures and a short onboarding guide, then ran a pilot with one team and fixed their issues before opening it up. Result: all three teams moved within a quarter, VM costs dropped and Grid-related failures fell sharply.
14

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

How would you design a CI pipeline for nightly regression?

Save to ▾
Show answer
Schedule the job, spin up environments or containers, run suites in parallel, store reports and screenshots, notify failures on Slack or email and track trends.
16

How do you fix a Maven dependency conflict?

Save to ▾
Show answer
Run mvn dependency:tree to see which versions are pulled in transitively. Maven picks the nearest version, which may not be the one you need. Fix by declaring the required version in dependencyManagement, excluding the unwanted transitive dependency with exclusions, or upgrading the library that brings the old version. Conflicts often appear as NoSuchMethodError or ClassNotFoundException at runtime.
17

What is performance testing and what are its main types?

Save to ▾
Show answer
Performance testing checks how fast, stable and scalable a system is under a given workload. Load testing measures behaviour at expected traffic. Stress testing pushes beyond capacity to find the breaking point and how the system recovers. Spike testing applies sudden jumps in users. Soak or endurance testing runs normal load for hours to find leaks. Scalability testing checks whether adding resources increases capacity as expected.
18

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).
19

List common TestNG annotations and their order.

Save to ▾
Show answer
BeforeSuite, BeforeTest, BeforeClass, BeforeMethod, Test, AfterMethod, AfterClass, AfterTest and AfterSuite.
20

Write a REST Assured test for a DELETE request followed by a check that the resource is gone.

Save to ▾
Show answer
@Test public void deleteUser() { int id = createTestUser(); given().spec(req).pathParam("id", id) .when().delete("/users/{id}") .then().statusCode(204); given().spec(req).pathParam("id", id) .when().get("/users/{id}") .then().statusCode(404); }
21

How do you handle multiple windows?

Save to ▾
Show answer
String parent = driver.getWindowHandle(); for (String h : driver.getWindowHandles()) if (!h.equals(parent)) driver.switchTo().window(h); // ...then switch back to parent
22

What are TestNG and JUnit 5 differences that matter in automation?

Save to ▾
Show answer
TestNG has built-in groups, dependencies, suite XML, DataProvider and flexible parallel options, which suit large Selenium suites. JUnit 5 has a modular platform, tags, parameterized tests, extensions and strong IDE and tool support, and is the default for Spring and Cucumber's JUnit Platform engine. Both are capable; the choice usually follows team standards and existing frameworks.
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

How do you group tests?

Save to ▾
Show answer
Tag tests with groups = {"smoke","regression"} and include or exclude them in testng.xml to run chosen sets.
25

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

What is OAuth 2.0 in API testing?

Save to ▾
Show answer
An authorisation framework where a client obtains an access token from an auth server and sends it as a Bearer token; tests fetch and reuse the token in setup.
27

How do you watch a test running inside a Docker Selenium container?

Save to ▾
Show answer
The selenium node and standalone images include a VNC server and noVNC. Expose port 7900 and open http://localhost:7900 in a browser; the default password is secret, or set SE_VNC_NO_PASSWORD to skip it. You can also open the Grid UI on port 4444 and click the session's video icon. This is very useful for debugging tests that fail only inside the container, such as layout or focus problems.
28

How do you handle a component that appears inside many different pages, like a modal dialog?

Save to ▾
Show answer
Create a ModalComponent class scoped to the modal root element, with methods like title(), confirm() and cancel(). Pages that open modals return the component, such as cartPage.removeItem() returning ConfirmModal. The component waits for itself to appear and disappear. This keeps modal logic in one place and avoids copying locators into every page.
29

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

What is an API and what are common HTTP methods?

Save to ▾
Show answer
An interface for systems to talk to each other. GET reads, POST creates, PUT replaces, PATCH updates partially and DELETE removes.
31

Where do you use OOP concepts in your framework?

Save to ▾
Show answer
Encapsulation: private locators with public page methods. Inheritance: pages extend a BasePage. Polymorphism: the WebDriver interface for different browsers. Abstraction: utility layers hiding Selenium details.
32

What are page components or page fragments in POM?

Save to ▾
Show answer
Components are classes for UI parts that repeat across pages, such as the header, search bar, date picker or a data table. A page object then has-a component: homePage.header().search("laptop"). This follows composition over inheritance, avoids duplicate locators and matches modern component-based frontends. Components are usually scoped to a root WebElement so locators search only inside that element.
33

Your CI pipeline is blocked because a downstream service needed for API tests is often down. What do you do?

Save to ▾
Show answer
Add a health check stage that pings dependencies before tests and marks the run as environment failure rather than test failure. For tests that do not need the real service, use stubs. Escalate with data on downtime frequency to the team owning the service. Keep a separate scheduled job for the real integration tests so pull requests are not blocked.
34

Tell me about a time you had to explain a technical test failure to a non-technical manager.

Save to ▾
Show answer
Situation: a release was blocked by failing tests and the manager wanted to know if it was safe to ship. Task: explain the risk without jargon. Action: I separated the failures into one real bug, where customers could be charged twice, and three environment issues. I showed the bug with a short screen recording. Result: the manager delayed the release by one day, the bug was fixed and the environment issues were assigned to DevOps.
35

What is the use of Maven in automation projects?

Save to ▾
Show answer
It manages dependencies through pom.xml, builds the project, runs tests with Surefire and standardises structure across teams.
36

What is a DataTable in Cucumber and how do you use it?

Save to ▾
Show answer
A DataTable passes a table written under a step into the step definition. You can read it as List<String>, List<Map<String,String>>, Map<String,String> or convert rows into objects with a @DataTableType method. For example a step that creates several users can take a table of name, role and email. Unlike Scenario Outline, a DataTable feeds data into one step and the scenario runs once.

Companies with offices in Gurgaon (51)

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
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
Hardware & semiconductors

Apple

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Hyderabad, Bengaluru, Mumbai +1

View questions
Product

Adobe

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Noida, Bengaluru, Gurugram

View questions
Product

Salesforce

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Hyderabad, Bengaluru, Mumbai +1

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
E-commerce & consumer tech

Walmart

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Bengaluru, Chennai, Gurugram

View questions
E-commerce & consumer tech

Zomato

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Gurugram

View questions
Fintech

Mastercard

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Pune, Vadodara, Gurugram +1

View questions
Fintech

DE Shaw

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Hyderabad, Bengaluru, Gurugram

View questions
Fintech

Tower Research Capital

Automation Testing interview questions

  • 40 questions
  • 5 rounds

Gurugram

View questions
IT services

IBM

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Pune, Hyderabad +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
IT services

Nagarro

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Gurugram, Jaipur

View questions
IT services

EPAM Systems

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Hyderabad, Bengaluru, Pune +2

View questions
IT services

GlobalLogic

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Noida, Bengaluru, Gurugram +2

View questions

Frequently asked questions

Which companies hire Automation Testing professionals in Gurgaon?

Companies with large offices in Gurgaon include Accenture, Deloitte, Amazon, Google, Meta, Microsoft, Apple, Adobe, Salesforce, LinkedIn. Use their company pages below to practise employer-specific sets.

Are Automation Testing interviews in Gurgaon different from other cities?

The questions depend more on the company than the city. Gurgaon's mix of employers decides the style: Interviews often expect strong business understanding along with technical skills, especially for analytics and product-facing roles

How do I find Automation Testing jobs in Gurgaon?

Shortlist companies with Gurgaon offices, keep your CV focused on Automation Testing projects, apply on company career pages and job portals with the Gurgaon filter, and practise the questions on this page before each interview.