Skip to content

L&T Technology Services Automation Testing Interview Questions & Answers

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

About L&T Technology Services hiring for Automation Testing roles

L&T Technology Services is an engineering research and development services company and part of the Larsen & Toubro group. It works with clients in transportation, industrial products, telecom, medical devices and plant engineering on product design, embedded systems and digital engineering. In India it hires engineers for software, embedded, testing and data roles across its engineering and delivery centres.

For Automation Testing roles, this L&T Technology Services practice set focuses most on Page Object Model (6), TestNG Framework (6), Selenium Grid & Docker (5), Appium Mobile Automation (5). It has 18 easy, 22 medium questions, so you can start easy and work up to the harder ones.

Company type
IT services
Headquarters
Vadodara, India
Main India offices
Vadodara, Bengaluru, Chennai, Mysuru, Pune

L&T Technology Services Automation Testing interview process

  1. Online assessment (aptitude + technical MCQs)
  2. Technical interview
  3. Managerial round
  4. HR round

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

Solved for L&T Technology ServicesStart 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

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

Write the command to run a JMeter test in non-GUI mode and generate the HTML report.

Save to ▾
Show answer
# -n non-GUI, -t test plan, -l results file, -e -o HTML dashboard folder jmeter -n -t tests/checkout.jmx \ -l results/checkout.jtl \ -e -o results/html-report \ -Jusers=100 -Jrampup=60 -Jduration=600 # generate a report later from an existing JTL jmeter -g results/checkout.jtl -o results/html-report-2
03

How do you handle waits inside page objects?

Save to ▾
Show answer
Put explicit waits in page methods or BasePage helpers, not in tests. For example click() waits for elementToBeClickable before clicking, and a page's isLoaded() waits for a key element. Avoid Thread.sleep and avoid mixing implicit and explicit waits. Keep the timeout configurable so CI can use a slightly longer value than local runs.
04

What are the advantages of version control for test code?

Save to ▾
Show answer
Git tracks changes, enables code review, branching and rollback and lets teams collaborate on the framework safely.
05

Difference between absolute and relative XPath?

Save to ▾
Show answer
Absolute starts from the root (/html/...) and breaks easily; relative starts anywhere with // and is more stable, for example //input[@id='email'].
06

What are the standalone, hub and node, and distributed modes of Selenium Grid 4?

Save to ▾
Show answer
Standalone runs every Grid component and a local node in a single process, which suits a laptop or a single container. Hub and node mode runs the router, distributor, queue and session map together as the hub, with separate node processes registering to it, which is the usual team setup. Fully distributed mode runs each component separately, often on Kubernetes, for very large grids that need independent scaling and high availability.
07

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

How do you record a JMeter script with the HTTP(S) Test Script Recorder?

Save to ▾
Show answer
Add the recorder from Templates using the Recording template, which also creates a Thread Group and Recording Controller. Start the recorder on port 8888, set your browser or system proxy to localhost:8888 and import the ApacheJMeterTemporaryRootCA certificate so HTTPS works. Perform the user journey, then stop. Afterwards remove static resources and third-party calls, add correlation for dynamic values, parameterize data and add think time.
09

What is git stash and when would you use it?

Save to ▾
Show answer
git stash saves uncommitted changes and cleans the working directory so you can switch branches. Later, git stash pop reapplies them. Use it when you are halfway through a change and must quickly fix something on another branch. git stash list shows saved stashes, and git stash push -m "msg" names them. For longer work, a temporary commit on a branch is clearer.
10

What is a Jenkins agent and how do labels help run tests?

Save to ▾
Show answer
An agent is a machine or container that runs build steps on behalf of the Jenkins controller. Labels are tags given to agents, such as linux, docker or windows-chrome. In a pipeline, agent { label 'docker' } sends the job to a matching agent. Testers use labels to send UI tests to agents with browsers or Docker installed, and to keep heavy test runs off the controller, which should only coordinate.
11

What is the difference between noReset and fullReset in Appium?

Save to ▾
Show answer
By default Appium clears app data between sessions but keeps the app installed. noReset set to true keeps app data and login state, which speeds up tests but can leak state between them. fullReset set to true uninstalls and reinstalls the app, giving the cleanest state but adding time. A common approach is noReset for fast suites with explicit cleanup in the test, and fullReset only for first-launch or onboarding scenarios.
12

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

Difference between an abstract class and an interface?

Save to ▾
Show answer
An abstract class can hold state and concrete methods; an interface defines a contract (with default methods since Java 8). A class extends one abstract class but can implement many interfaces.
14

How do you manage test data in a framework?

Save to ▾
Show answer
Use external files or APIs and database setup scripts, generate unique data per run, and clean up afterwards so tests stay independent.
15

How do you run Selenium tests in Docker containers in CI?

Save to ▾
Show answer
Use official Selenium images, either standalone-chrome for simple runs or a Grid with hub and node containers via Docker Compose. The test container or Jenkins agent points RemoteWebDriver to http://selenium-hub:4444. Containers give the same browser version everywhere and are cleaned after each run. Add shm_size for Chrome stability and record videos for failed tests if needed.
16
Save to ▾
Show answer
String r = new StringBuilder(s).reverse().toString(); // or loop from the last index and append each character
17

How do you pass the WebDriver to page objects in a parallel framework?

Save to ▾
Show answer
Use a DriverManager with a ThreadLocal<WebDriver>, created in @BeforeMethod and removed in @AfterMethod. Page objects receive the driver through the constructor or get it from DriverManager.getDriver(). Constructor injection is cleaner and easier to test. Never store the driver in a static field shared by all threads, or parallel tests will control each other's browsers.
18

What is the difference between @Test(priority) and dependsOnMethods in TestNG?

Save to ▾
Show answer
priority only orders tests; a lower number runs first, and a failed test does not stop the others. dependsOnMethods creates a real dependency: if the parent test fails, dependent tests are skipped. Both make tests order-dependent, which hurts parallel runs and isolation, so use them sparingly. Prefer independent tests with their own setup.
19

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.
20
Save to ▾
Show answer
String is immutable — every change creates a new object. StringBuilder is mutable and faster for repeated changes (not thread-safe; StringBuffer is).
21

How do you verify that an element is displayed, enabled or selected?

Save to ▾
Show answer
Use isDisplayed(), isEnabled() and isSelected() on the WebElement before interacting or asserting.
22

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

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

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

Why is XPath slow in Appium and what should you use instead?

Save to ▾
Show answer
For every XPath query Appium must fetch the full page source of the app, convert it into an XML document and then evaluate the expression, which can take seconds on large screens and is even slower on iOS. Index-based XPath also breaks when layouts change. Use accessibility id first, then resource-id, Android UiAutomator selectors or iOS predicate strings and class chains, which are evaluated natively on the device and are much faster.
26

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

What is Docker Compose and why is it useful for Selenium Grid?

Save to ▾
Show answer
Docker Compose lets you define several containers, their images, ports, environment variables and networks in one docker-compose.yml file and start them together with docker compose up. For Selenium it means a hub plus Chrome, Firefox and Edge nodes, and even the application under test, start with one command on any laptop or CI agent. The file is version-controlled, so every tester and pipeline uses the same Grid setup.
28

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

What is the difference between a Docker image and a container?

Save to ▾
Show answer
An image is a read-only template that contains an operating system layer, software and configuration, for example selenium/standalone-chrome with Chrome and ChromeDriver installed. A container is a running instance of an image with its own process, network and writable layer. You can start many containers from one image and destroy them after a test run. This is why every run starts from the same clean browser environment.
30

What is a smoke test versus a sanity test in a pipeline?

Save to ▾
Show answer
A smoke test is a broad, shallow check that the build is stable enough for further testing, such as the app launches, login works and main pages load. A sanity test is a narrow check after a specific fix or change to confirm it works. In pipelines, smoke runs on every deploy as a gate; sanity checks are targeted runs for a particular change.
31

Write a REST Assured test that deserializes a response into a POJO.

Save to ▾
Show answer
@Test public void getUserAsPojo() { User user = given() .pathParam("id", 2) .when() .get("/users/{id}") .then() .statusCode(200) .extract().as(User.class); Assert.assertEquals(user.getId(), 2); Assert.assertNotNull(user.getEmail()); }
32

What is the Maven Failsafe plugin and how is it different from Surefire?

Save to ▾
Show answer
Surefire runs unit tests in the test phase and stops the build as soon as tests fail. Failsafe runs integration tests in the integration-test phase and checks results later in the verify phase, so post-integration-test steps, like stopping a server or Docker containers, still run after failures. By default Failsafe picks classes named *IT. Many teams run UI and API suites through Failsafe with mvn verify for that reason.
33

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
34

What is the purpose of testng.xml?

Save to ▾
Show answer
A configuration file to define suites, tests, classes, groups, parameters and parallel execution settings.
35

Write a simple page object class for a login page.

Save to ▾
Show answer
public class LoginPage { private final WebDriver driver; private final By user = By.id("username"); private final By pass = By.id("password"); private final By submit = By.cssSelector("button[type='submit']"); public LoginPage(WebDriver driver) { this.driver = driver; } public HomePage loginAs(String u, String p) { driver.findElement(user).sendKeys(u); driver.findElement(pass).sendKeys(p); driver.findElement(submit).click(); return new HomePage(driver); } }
36

What are the main elements of a JMeter test plan?

Save to ▾
Show answer
A test plan contains Thread Groups that simulate users, Samplers such as HTTP Request that send requests, Config Elements like HTTP Request Defaults, CSV Data Set Config and Header Manager, Logic Controllers that control flow, Timers that add think time, Pre and Post Processors that prepare data or extract values, Assertions that validate responses, and Listeners that collect results. Elements apply according to their scope in the tree.
37

What is the Hybrid framework?

Save to ▾
Show answer
A framework combining data-driven, keyword-driven and POM approaches with reporting and utilities, giving flexibility and reuse.
38

What is a constructor and can it be overloaded?

Save to ▾
Show answer
A special method that initialises an object. It can be overloaded with different parameters, and testers use it to pass the WebDriver into page classes.
39

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

Tell me about a time you moved from web automation to mobile automation.

Save to ▾
Show answer
Situation: my team needed Android regression tests and I only knew Selenium. Task: deliver a smoke suite in one month. Action: I learned Appium 2 setup, used Appium Inspector to find locators, asked developers to add accessibility ids, and reused our TestNG, POM and reporting structure with a new driver factory. Result: twenty smoke tests ran nightly on emulators within four weeks, and release smoke testing dropped from half a day to forty minutes.

Tips to crack the L&T Technology Services Automation Testing interview

  • Revise core engineering subjects from your branch along with C, basic data structures and one scripting language before the technical round.
  • Be ready to explain an academic or internship project end to end, including design choices, tools used and testing approach.
  • Read about LTTS segments like mobility, medical devices and plant engineering so you can connect your skills to a domain.
  • 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; L&T Technology Services interviewers usually ask follow-ups on your first answer.

Frequently asked questions

How many rounds are there in the L&T Technology Services Automation Testing interview?

Candidates usually go through 4 stages: Online assessment (aptitude + technical MCQs); Technical interview; 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 L&T Technology Services Automation Testing interview?

This practice set leans on Page Object Model (6), TestNG Framework (6), Selenium Grid & Docker (5), Appium Mobile Automation (5). Revise those first, then practise explaining one or two of your own projects end to end, because most L&T Technology Services interviewers ask you to walk through real work.

Are these the exact questions asked at L&T Technology Services?

No. These are curated practice questions that match the skills and difficulty usually tested in it services interviews like L&T Technology Services's. They are not a leaked or verified list of past questions.

Where does L&T Technology Services hire Automation Testing professionals in India?

L&T Technology Services has large teams in Vadodara, Bengaluru, Chennai, Mysuru, Pune. Openings and locations change often, so check the L&T Technology Services careers page and filter by city and experience.

Automation Testing questions for similar companies