Skip to content

Automation Testing Interview Questions for IT services Companies

40 questions weighted to the interview style of it services companies — 18 easy, 19 medium, 3 hard.

How it services companies interview for Automation Testing

IT services companies hire in large numbers, often in campus or bulk drives. Interviews usually start with an online aptitude and coding test, then one or two technical rounds on fundamentals and your projects, then HR. Clear basics and good communication matter more than rare, advanced topics.

This set focuses on Page Object Model (7), Performance Testing with JMeter (4), REST Assured (4), Selenium Grid & Docker (4).

Technical interview HR round Managerial round Coding test Online assessment (aptitude + reasoning)
Solved — it services 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 are timers in JMeter and why is think time important?

Save to ▾
Show answer
By default JMeter fires requests back to back, which is far more aggressive than real users who read pages and fill forms. Timers add delays: Constant Timer, Uniform Random Timer and Gaussian Random Timer add think time, while Constant Throughput Timer and Precise Throughput Timer control request rate. Realistic think time makes the user count meaningful; without it, 100 threads may generate the load of thousands of real users.
02

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

What is correlation in JMeter and why is it needed?

Save to ▾
Show answer
Correlation means capturing dynamic values from one response and passing them into later requests. Session ids, CSRF tokens, auth tokens and order ids change every run, so a recorded script with hard-coded values fails on replay. In JMeter you use post-processors such as JSON Extractor, Regular Expression Extractor or CSS Selector Extractor to save the value into a variable, then reference it as ${token} in later headers or bodies.
04

What is the New Session Queue in Selenium Grid 4 and what happens when all slots are busy?

Save to ▾
Show answer
When a test requests a session and no node slot matches, the request waits in the New Session Queue instead of failing immediately. The distributor picks it up when a matching slot frees. If it waits longer than the session request timeout, which is 300 seconds by default, the client gets a SessionNotCreatedException. Tuning this timeout and matching thread count to slot count prevents long waits and timeouts in CI.
05

How do you test API security basics as an automation tester?

Save to ▾
Show answer
Check that endpoints reject missing or invalid tokens with 401, block users from other users' data with 403 or 404, validate input to prevent injection, do not leak stack traces or sensitive fields, enforce HTTPS and set security headers. Automate these as negative tests in the regression suite and work with the security team for deeper penetration testing.
06

What are JMeter listeners and why should you avoid most of them during a load run?

Save to ▾
Show answer
Listeners collect and display results, such as View Results Tree, Summary Report and Aggregate Report. Visual listeners keep every sample in memory and redraw graphs, which consumes a lot of CPU and RAM and can make JMeter itself the bottleneck. During real load runs disable them, run in non-GUI mode, write raw results to a JTL file and generate the HTML dashboard afterwards. Use View Results Tree only for debugging.
07

A login action can lead either to the dashboard or to an error message. How should the page object method return?

Save to ▾
Show answer
Make the outcome explicit with separate methods instead of one method guessing. For example loginAs(user) returns DashboardPage for valid credentials, while loginExpectingError(user) returns the same LoginPage so the test can check the error. Each method waits for its expected page and fails clearly if it does not appear. This keeps tests readable and avoids returning a generic Object or checking types in tests.
08

What are the three amigos in BDD?

Save to ▾
Show answer
The three amigos are the business representative (product owner or BA), the developer and the tester, who meet before development to discuss a story. They agree on rules and concrete examples, which become Gherkin scenarios. The meeting catches misunderstandings early, before code is written. Cucumber automation is the output, but the conversation is the real value of BDD.
09

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

What are try-with-resources and why use them?

Save to ▾
Show answer
A try block that automatically closes resources such as file readers or streams, preventing leaks without a finally block.
11

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

Write an XPath for a button with the text "Login".

Save to ▾
Show answer
//button[normalize-space()='Login'] //button[contains(text(),'Login')]
13

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

Write a DataProvider that supplies two sets of login data and a test that uses it.

Save to ▾
Show answer
@DataProvider(name = "logins") public Object[][] logins() { return new Object[][] { {"asha", "Valid@1", true}, {"asha", "wrong", false} }; } @Test(dataProvider = "logins") public void login(String user, String pass, boolean ok) { boolean result = loginPage.loginAs(user, pass).isLoggedIn(); Assert.assertEquals(result, ok); }
15

What is the Page Object Model?

Save to ▾
Show answer
A design pattern where each page is a class holding its locators and actions, so tests stay readable and a locator change is fixed in one place.
16

What is a step definition in Cucumber?

Save to ▾
Show answer
A step definition is a Java method annotated with @Given, @When or @Then whose expression matches a Gherkin step. When Cucumber runs a feature, it finds the matching method and executes it, passing captured parameters as arguments. Keep step definitions thin: they should call page objects or API helpers rather than contain Selenium code directly, so the same steps stay reusable across many features.
17

What is Appium Inspector and how do you use it?

Save to ▾
Show answer
Appium Inspector is a desktop or web tool that connects to an Appium server with your capabilities and shows a live screenshot of the app with its element tree. Clicking an element shows its attributes such as accessibility id, resource-id, text and bounds, and suggests locators. You can also try taps and swipes interactively. Testers use it to find stable locators and to check whether an element is really present before writing code.
18

How do you make page objects work with dynamic locators, such as a row containing a given name?

Save to ▾
Show answer
Write a method that builds the locator from a parameter, for example private By rowFor(String name) { return By.xpath("//tr[td[normalize-space()='" + name + "']]"); }, and expose actions like deleteUser(name). Keep the template in the page class, not in tests. Escape quotes if names may contain them, and prefer CSS with data attributes when the application provides them.
19

Common HTTP status codes?

Save to ▾
Show answer
200 OK, 201 Created, 204 No Content, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 500 Internal Server Error.
20

How do you extract a value from one response and use it in the next request?

Save to ▾
Show answer
String token = given().body(creds).when().post("/login") .then().statusCode(200) .extract().path("token"); given() .header("Authorization", "Bearer " + token) .when() .get("/orders") .then() .statusCode(200);
21

What is the difference between == and equals() in Java?

Save to ▾
Show answer
== compares references (or primitive values); equals() compares content when overridden, as in String.
22

How do you resolve a merge conflict in Git?

Save to ▾
Show answer
Git marks conflicting sections with <<<<<<<, ======= and >>>>>>>. Open each file, decide which change to keep or combine both, remove the markers, then git add the files and complete with git commit (or git rebase --continue). Run the affected tests before pushing. Pull often and keep branches short-lived to reduce conflicts.
23

Write a REST Assured test using RequestSpecBuilder and ResponseSpecBuilder.

Save to ▾
Show answer
RequestSpecification req = new RequestSpecBuilder() .setBaseUri(Config.baseUrl()) .setContentType(ContentType.JSON) .addHeader("Authorization", "Bearer " + token) .build(); ResponseSpecification ok = new ResponseSpecBuilder() .expectStatusCode(200) .expectContentType(ContentType.JSON) .build(); given().spec(req).when().get("/orders").then().spec(ok);
24

How do you get reports, screenshots and downloaded files out of a Docker container?

Save to ▾
Show answer
Use volumes. A bind mount maps a host folder into the container, for example -v $(pwd)/target:/app/target, so reports written in the container appear on the CI agent for archiving. Named volumes are managed by Docker and suit data that should survive restarts. For browser downloads, mount the node's download folder or enable the Grid's managed downloads with the se:downloadsEnabled capability to fetch files through the Grid API.
25

What is RemoteWebDriver and how is it different from ChromeDriver?

Save to ▾
Show answer
ChromeDriver starts and controls a browser on the same machine as the test. RemoteWebDriver sends the same WebDriver commands over HTTP to a remote endpoint, such as a Selenium Grid, a Docker container or a cloud provider, which starts the browser elsewhere. You pass the Grid URL and browser options, and the rest of the test code stays the same. ChromeDriver itself actually extends RemoteWebDriver.
26

What are listeners in TestNG?

Save to ▾
Show answer
Classes like ITestListener that react to events such as test start, success or failure, commonly used for screenshots and reporting.
27

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

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

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

What are Cucumber hooks and how are they different from Background?

Save to ▾
Show answer
Hooks are Java methods annotated with @Before, @After, @BeforeStep and @AfterStep that run around scenarios or steps. Background is visible in the feature file and describes business preconditions; hooks are hidden technical setup such as starting the browser, cleaning data or attaching screenshots. Hooks can be ordered with the order attribute and filtered by tag expressions, for example @Before("@ui").
31

What is WebDriver and how does it communicate with the browser?

Save to ▾
Show answer
WebDriver sends commands over HTTP (W3C protocol) to a browser-specific driver such as chromedriver, which controls the actual browser.
32

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

How do you avoid page object classes becoming too large?

Save to ▾
Show answer
Split pages into components for repeated or complex areas, keep only user actions as public methods, move generic helpers to BasePage or utilities, and avoid one method per element. If a page has distinct modes like view and edit, use separate classes. Review page classes during code review and refactor when they cross a few hundred lines.
34

What is Docker and how does it help tests?

Save to ▾
Show answer
Docker packages tools in containers so tests run identically everywhere; Selenium Grid and browsers can be started quickly in containers.
35

Method overloading vs overriding?

Save to ▾
Show answer
Overloading: same method name, different parameters, in the same class (compile time). Overriding: a subclass redefines a parent method with the same signature (runtime polymorphism). WebDriver driver = new ChromeDriver() is runtime polymorphism.
36

Write a Scenario Outline for login with three data sets.

Save to ▾
Show answer
Scenario Outline: Login with different users Given the user is on the login page When the user logs in with "<username>" and "<password>" Then the message "<message>" is shown Examples: | username | password | message | | asha | Valid@1 | Welcome Asha | | asha | wrong | Invalid password | | locked1 | Valid@1 | Account is locked |
37

How do you test negative scenarios for an API?

Save to ▾
Show answer
Send invalid or missing fields, wrong data types, values beyond limits, invalid IDs, expired or missing tokens, wrong HTTP methods and malformed JSON. Assert the correct status (400, 401, 403, 404, 405, 422) and a clear error body without stack traces. Negative tests often find more defects than happy paths because validation and security checks are frequently incomplete.
38

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

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

How do you verify that the correct page has loaded in POM?

Save to ▾
Show answer
Give each page an isAt() or waitUntilLoaded() method that waits for a unique element, page title or URL fragment. Call it in the constructor or right after navigation. If it fails, throw a clear error such as "Expected Cart page but URL was /login". This catches navigation problems at the right point instead of failing later with a confusing locator error.

IT services companies (33)

IT services

TCS

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Mumbai, Chennai, Pune +2

View questions
IT services

Infosys

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Mysuru, Pune +2

View questions
IT services

Wipro

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Hyderabad, Pune +2

View questions
IT services

Cognizant

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Chennai, Bengaluru, Pune +2

View questions
IT services

Capgemini

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Mumbai, Bengaluru, Pune +2

View questions
IT services

HCLTech

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Noida, Chennai, Bengaluru +2

View questions
IT services

Tech Mahindra

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Pune, Hyderabad, Bengaluru +2

View questions
IT services

IBM

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Pune, Hyderabad +2

View questions
IT services

Mphasis

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Pune, Chennai

View questions
IT services

LTIMindtree

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Mumbai, Pune, Bengaluru +2

View questions
IT services

Persistent Systems

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Pune, Nagpur, Bengaluru +2

View questions
IT services

Hexaware

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Navi Mumbai, Chennai, Pune +2

View questions
IT services

Coforge

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Noida, Greater Noida, Bengaluru +2

View questions
IT services

Zensar Technologies

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Pune, Hyderabad, Bengaluru

View questions
IT services

Birlasoft

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Pune, Noida, Bengaluru +1

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
IT services

Virtusa

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Hyderabad, Chennai, Bengaluru

View questions
IT services

UST

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Thiruvananthapuram, Kochi, Bengaluru +2

View questions
IT services

CGI

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Hyderabad, Chennai +1

View questions
IT services

NTT DATA

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Pune, Noida +2

View questions
IT services

Genpact

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Gurugram, Hyderabad, Bengaluru +2

View questions
IT services

L&T Technology Services

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Vadodara, Bengaluru, Chennai +2

View questions
IT services

Cyient

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Hyderabad, Bengaluru, Noida

View questions
IT services

Sonata Software

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Hyderabad

View questions
IT services

Mastek

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Mumbai, Pune

View questions
IT services

Happiest Minds Technologies

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Noida

View questions
IT services

KPIT Technologies

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Pune, Bengaluru

View questions
IT services

Tata Elxsi

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Thiruvananthapuram, Chennai +1

View questions
IT services

Quest Global

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Bengaluru, Thiruvananthapuram, Belagavi +1

View questions
IT services

Infogain

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Noida, Gurugram, Pune +1

View questions
IT services

YASH Technologies

Automation Testing interview questions

  • 40 questions
  • 4 rounds

Indore, Pune, Hyderabad

View questions

Frequently asked questions

How are Automation Testing interviews at it services companies different?

IT services companies hire in large numbers, often in campus or bulk drives. Interviews usually start with an online aptitude and coding test, then one or two technical rounds on fundamentals and your projects, then HR. Clear basics and good communication matter more than rare, advanced topics.

Which it services companies are covered?

This page links to 33 it services companies, including TCS, Infosys, Wipro, Cognizant, Capgemini, HCLTech, Tech Mahindra, IBM. 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; HR round; Managerial round; Coding test; Online assessment (aptitude + reasoning). The exact process varies by company and role.