Skip to content

Siemens Automation Testing Interview Questions & Answers

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

About Siemens hiring for Automation Testing roles

Siemens is a German technology company working in industrial automation, digital industries software, smart infrastructure, mobility and healthcare through Siemens Healthineers. Its India entities include engineering and technology centres in Bengaluru and Pune. It hires for software engineers, test engineers, data analysts and engineers working on industrial software and IoT.

For Automation Testing roles, this Siemens practice set focuses most on Selenium WebDriver (9), Selenium Grid & Docker (5), Core Java for Testers (5), Page Object Model (4). It has 7 easy, 30 medium, 3 hard questions, so you can start easy and work up to the harder ones.

Company type
Hardware & semiconductors
Headquarters
Munich, Germany
Main India offices
Mumbai, Bengaluru, Pune

Siemens Automation Testing interview process

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

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

Solved for SiemensStart 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 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(); }
02

How do you switch between windows and tabs?

Save to ▾
Show answer
Get getWindowHandles(), loop to find the target, and call driver.switchTo().window(handle); switch back using the stored parent handle.
03

Write Java code to create a RemoteWebDriver for a Selenium Grid using ChromeOptions.

Save to ▾
Show answer
String gridUrl = System.getProperty("grid.url", "http://localhost:4444"); ChromeOptions options = new ChromeOptions(); options.addArguments("--window-size=1920,1080"); options.setCapability("se:name", "Login smoke test"); WebDriver driver = new RemoteWebDriver(new URL(gridUrl), options); try { driver.get("https://app.test/login"); } finally { driver.quit(); }
04

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
05

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

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'].
07

How do you handle StaleElementReferenceException?

Save to ▾
Show answer
Re-locate the element after the DOM refreshes, use explicit waits for the refreshed element, don't keep element references for long, or wrap the action in retry logic.
08

Your Selenium tests in CI produce blank screenshots in headless mode. What could be wrong?

Save to ▾
Show answer
The screenshot may be taken before the page renders, the window size in headless mode may be tiny, or the browser is crashing due to low shared memory in Docker. Set --window-size=1920,1080, use the new headless mode, wait for page content before capturing, and add --disable-dev-shm-usage or a larger shm size for containers.
09

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

What is ITestContext in TestNG and how can you use it to share data?

Save to ▾
Show answer
ITestContext represents one test tag from testng.xml and is passed to listeners and configuration methods. It holds the suite, included methods and results, and has setAttribute and getAttribute to share values, such as an auth token created in @BeforeTest and read by later classes. Because it is shared by every thread in that test tag, store only thread-safe or read-only data there, not WebDriver instances during parallel runs.
11

ArrayList vs HashMap — how do you use them in a framework?

Save to ▾
Show answer
ArrayList stores an ordered list (e.g. all product names on a page). HashMap stores key–value pairs (e.g. test data or config properties).
12

What is the difference between driver.close() and driver.quit()?

Save to ▾
Show answer
close() closes the current window; quit() closes all windows and ends the driver session.
13

How do you upload a file with REST Assured?

Save to ▾
Show answer
Use multipart: given().multiPart("file", new File("src/test/resources/report.pdf"), "application/pdf").formParam("type", "invoice").when().post("/upload").then().statusCode(200). REST Assured sets the multipart/form-data content type automatically. Verify both the status and the response, such as the returned file id or size, and test edge cases like empty, oversized and wrong-type files.
14

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

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

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

What is the difference between an array and an ArrayList?

Save to ▾
Show answer
Arrays have a fixed size and can hold primitives; ArrayList grows dynamically, holds objects and offers helper methods.
18

How do you test an API that depends on another service that is down?

Save to ▾
Show answer
Use mocks or stubs such as WireMock to simulate the dependency and test your service in isolation.
19

How do you mock an external API in automation tests?

Save to ▾
Show answer
Use a tool such as WireMock or MockServer to run a stub server that returns predefined responses for given requests. Point the application or tests to the stub with configuration. This lets you test error codes, timeouts and edge cases that are hard to trigger on the real service, and keeps tests stable when the third party is down. Still keep a few tests against the real integration.
20

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

Tests running inside Docker cannot reach the application running on the host's localhost. Why, and how do you fix it?

Save to ▾
Show answer
Inside a container, localhost means the container itself, not the host machine. On Docker Desktop use host.docker.internal as the host name. On Linux add extra_hosts with host.docker.internal:host-gateway, or use the host's IP. A cleaner option is running the application in the same Compose network and calling it by its service name, such as http://web:8080. Make sure the app listens on 0.0.0.0, not only 127.0.0.1.
22

How do you store passwords and tokens safely in Jenkins?

Save to ▾
Show answer
Use the Jenkins Credentials store and bind them in the pipeline with withCredentials or the credentials() helper in environment blocks. Jenkins masks the values in console logs. Never hard-code secrets in the Jenkinsfile, pom.xml or properties files committed to Git. For larger setups, integrate a vault service and give each job only the credentials it needs.
23

What is consumer-driven contract testing with Pact?

Save to ▾
Show answer
In consumer-driven contracts, the consumer's tests record the requests it makes and the responses it expects into a pact file. The provider runs a verification against that pact to prove it still meets every consumer's needs. A Pact Broker stores contracts and can block deployments that break a consumer. It catches integration breaks without needing all services deployed together.
24

What is TestNG and why is it used with Selenium?

Save to ▾
Show answer
A test framework offering annotations, grouping, prioritisation, parallel runs, data providers and reports, which structure and scale Selenium tests.
25

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

How would you design an automation framework from scratch?

Save to ▾
Show answer
Maven project → POM with a BasePage → driver factory with ThreadLocal → config files → data-driven utilities (Excel/JSON) → TestNG or Cucumber runner → logging → Extent reports with screenshots on failure → Jenkins pipeline.
27

How do you run JavaScript in Selenium?

Save to ▾
Show answer
Cast the driver to JavascriptExecutor and use executeScript, for example to scroll into view or click hidden elements.
28

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

How do you test an API that returns paginated results?

Save to ▾
Show answer
Call the first page, check page size, total count and the next link or cursor. Loop through pages until there is no next page, collecting IDs, then assert no duplicates and the total matches the reported count. Also test edge cases: page 0, a page beyond the last, invalid page size and sorting stability. Cap the loop to avoid endless runs if the API misbehaves.
30

Why do Selenium browser containers need a larger shm_size?

Save to ▾
Show answer
Chrome and Firefox use shared memory at /dev/shm for rendering and inter-process communication. Docker gives containers only 64 MB of shared memory by default, which is not enough for modern pages, so the browser tab crashes with errors like session deleted because of page crash. Setting shm_size to 2g in Compose, or --shm-size=2g with docker run, fixes it. Mounting /dev/shm from the host is an alternative.
31

How do you upload a file with Selenium?

Save to ▾
Show answer
If the element is <input type="file">, use element.sendKeys("C:/path/file.pdf"). Use the Robot class or AutoIt only as a last resort for OS dialogs.
32

What is parameterization in JMeter and how does CSV Data Set Config work?

Save to ▾
Show answer
Parameterization replaces hard-coded inputs with varied test data so users do not all log in as the same account or search the same item, which would give unrealistic cache hits. CSV Data Set Config reads a CSV file line by line and stores columns into variables like ${username} and ${password}. You set the file path, variable names, delimiter, whether to recycle at end of file and the sharing mode across threads.
33

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

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);
35

You see ConcurrentModificationException in your test utility. What causes it and how do you fix it?

Save to ▾
Show answer
It occurs when a collection is modified while being iterated with a for-each loop, for example removing items from an ArrayList inside the loop. Fix by using Iterator.remove(), removeIf(), collecting items to remove separately, or using CopyOnWriteArrayList or ConcurrentHashMap when threads share the collection. In parallel tests, shared lists are a common source.
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

Tell me about a time you mentored a junior tester in Java and automation.

Save to ▾
Show answer
Situation: two new joiners from manual testing struggled with framework code. Task: help them contribute within a sprint. Action: I paired with them daily for an hour, gave small tasks like adding a locator then a full test, and reviewed their code with explanations rather than rewriting it. Result: within three weeks both were writing tests independently, and our automation backlog shrank.
38

How do you rerun only failed Cucumber scenarios?

Save to ▾
Show answer
Add the rerun plugin, for example rerun:target/failed.txt, to the main runner. It writes the location of each failed scenario. Create a second runner whose features point to @target/failed.txt and run it after the main run in Maven or Jenkins. Use reruns to separate real failures from flaky ones, but track flaky scenarios and fix them instead of hiding them.
39

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

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

Tips to crack the Siemens Automation Testing interview

  • Learn basics of industrial automation, PLCs and IoT, which connect to many Siemens software and testing roles.
  • Read about Siemens Xcelerator and digital twin concepts used in its industrial software.
  • Revise C++, Java or Python and testing fundamentals depending on the team you are applying to.
  • 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; Siemens interviewers usually ask follow-ups on your first answer.

Frequently asked questions

How many rounds are there in the Siemens Automation Testing interview?

Candidates usually go through 5 stages: Online assessment (aptitude + technical); Technical round 1; Technical round 2; 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 Siemens Automation Testing interview?

This practice set leans on Selenium WebDriver (9), Selenium Grid & Docker (5), Core Java for Testers (5), Page Object Model (4). Revise those first, then practise explaining one or two of your own projects end to end, because most Siemens interviewers ask you to walk through real work.

Are these the exact questions asked at Siemens?

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

Where does Siemens hire Automation Testing professionals in India?

Siemens has large teams in Mumbai, Bengaluru, Pune. Openings and locations change often, so check the Siemens careers page and filter by city and experience.

Automation Testing questions for similar companies