Skip to content

Mobile Automation Tester Interview Questions & Answers

40 questions for Mobile Automation Tester interviews — 5 easy, 28 medium, 7 hard.

About the Mobile Automation Tester role

Automates functional and regression tests for Android and iOS apps using Appium with Java, TestNG and the Page Object Model. Works on emulators, real devices and cloud device farms, handles gestures, permissions and hybrid webviews, and runs suites in CI. Interviews test Appium architecture and capabilities, mobile locator strategies, gestures with W3C Actions, parallel device runs and how you debug failures that appear only on specific devices.

Appium 2 Core Java Mobile locators and gestures TestNG and POM Device farms and CI
Solved for this roleStart 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 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.
02

How do you capture a screen recording of a mobile test and attach it on failure?

Save to ▾
Show answer
// Start before the test, stop and save only if it fails driver.startRecordingScreen(); // ... test steps ... String base64 = driver.stopRecordingScreen(); if (result.getStatus() == ITestResult.FAILURE) { byte[] video = Base64.getDecoder().decode(base64); Files.write(Paths.get("target/videos/" + result.getName() + ".mp4"), video); }
03

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

You configured 50 parallel threads but only 8 tests run at a time on the Grid. Why?

Save to ▾
Show answer
The Grid only has 8 free slots, so the other requests wait in the New Session Queue. Total parallelism equals nodes multiplied by max sessions per node, not the TestNG thread count. Check the Grid UI for slot count. To run more, scale the node containers, raise max sessions if hardware allows, or use a larger grid. Otherwise reduce threads to match slots so waiting requests do not time out.
05

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

What is CI/CD and why does automation need it?

Save to ▾
Show answer
Continuous Integration builds and tests every commit, and Continuous Delivery ships automatically. Automated tests give fast feedback and gate releases.
07

How do you handle environment-specific configuration?

Save to ▾
Show answer
Keep URLs and credentials in per-environment config files or variables, choose with a command-line parameter and never hard-code secrets.
08

A utility method that parses dates from the UI breaks in parallel runs. What might be wrong?

Save to ▾
Show answer
It probably uses a shared static SimpleDateFormat, which is not thread-safe, so parallel threads corrupt each other's parsing. Replace it with java.time DateTimeFormatter, which is immutable and thread-safe, and LocalDate or LocalDateTime for values. Generally, avoid shared mutable static objects in test utilities that run in parallel.
09

What is the LoadableComponent pattern in Selenium?

Save to ▾
Show answer
LoadableComponent is a Selenium support class that standardises how a page object ensures it is loaded. You extend it and implement load(), which navigates to the page, and isLoaded(), which throws an Error if the page is not ready. Calling get() checks isLoaded and calls load only if needed, then checks again. It gives a consistent, self-verifying way to open pages and fails fast with a clear message.
10

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

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

An element is visible in Appium Inspector but your test throws NoSuchElementException on the device. What do you check?

Save to ▾
Show answer
First check timing: the screen may still be loading, so add an explicit wait for presence. Then check context: in a hybrid app the element may be in a webview while you are in NATIVE_APP. Confirm the locator matches exactly, including package prefix in resource-id. The element may be off screen in a list, so scroll first. Also check that the Inspector session used the same app build, language and device size as the test.
13

Your 200 mobile tests across six devices take too long to finish. How would you speed them up?

Save to ▾
Show answer
Run devices in parallel with one thread per device, each with its own udid, systemPort or wdaLocalPort. Use deep links or API calls to reach the screen under test instead of navigating through the UI every time. Prefer noReset with explicit data cleanup over reinstalling the app. Replace XPath with accessibility ids. Split the suite so pull requests run a small smoke set on emulators while the full device matrix runs nightly.
14

Describe a time you improved the maintainability of an automation framework.

Save to ▾
Show answer
Situation: our suite had duplicated locators across 200 tests and each UI release broke many of them. Task: reduce maintenance effort. Action: I introduced page objects and components for the top ten pages, added data-testid attributes with the developers and wrote a short guide. Result: fixing a UI change went from half a day to under an hour, and new joiners wrote tests faster.
15

Write Java code to count the occurrences of each character in a string.

Save to ▾
Show answer
String s = "automation"; Map<Character, Integer> counts = new LinkedHashMap<>(); for (char c : s.toCharArray()) { counts.put(c, counts.getOrDefault(c, 0) + 1); } System.out.println(counts); // a=2, u=1, t=2, o=2, m=1, i=1, n=1
16

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

Write a Java stream that extracts and sorts product prices from a list of WebElements.

Save to ▾
Show answer
List<Double> prices = driver.findElements(By.cssSelector(".price")) .stream() .map(WebElement::getText) .map(t -> t.replaceAll("[^0-9.]", "")) .map(Double::parseDouble) .sorted() .collect(Collectors.toList()); System.out.println(prices);
18

How do you test deep links in a mobile app with Appium?

Save to ▾
Show answer
On Android use the mobile: deepLink command with the URL and package, for example driver.executeScript("mobile: deepLink", Map.of("url", "shop://product/42", "package", "com.example.shop")). On iOS simulators driver.get with the custom URL opens it, though Safari may show a confirm dialog to handle. Then assert that the correct screen and data are shown. Deep links are also a great shortcut to reach deep screens quickly in other tests.
19

How do you take a screenshot on failure in TestNG?

Save to ▾
Show answer
Implement ITestListener.onTestFailure(): File src = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); then copy it into the reports folder.
20

Mobile tests pass on the emulator but fail on a low-end real device. How do you investigate?

Save to ▾
Show answer
Low-end devices are slower, so fixed waits and short timeouts expire before screens render. Replace sleeps with explicit waits and increase timeouts sensibly. Check for vendor-specific pop-ups, battery optimisation dialogs or different keyboards on that brand. Compare screen size and resolution, since coordinate-based taps break. Collect device logs with adb logcat and screen recordings to see what the app was doing. Also check whether the app crashed due to low memory.
21

How do you calculate automation ROI?

Save to ▾
Show answer
Compare effort saved by running automated tests repeatedly against the cost of building and maintaining scripts, counting execution time, defects found earlier and release speed.
22

PageFactory with @FindBy or By locators: which do you prefer and why?

Save to ▾
Show answer
Many teams now prefer plain By locators with explicit waits. PageFactory proxies look up elements lazily, which can hide timing problems and makes StaleElementReference harder to reason about, and its AjaxElementLocatorFactory waits are less flexible. PageFactory is fine and readable for stable pages. The key is consistency across the framework and always waiting for the right condition before acting.
23

What is the difference between hard and soft assertions?

Save to ▾
Show answer
Hard assert stops the test at the first failure; SoftAssert collects failures and reports them together when assertAll() is called.
24

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

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

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

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

How did you handle it when your test estimates turned out to be wrong in a sprint?

Save to ▾
Show answer
Situation: I estimated three days to automate a new module, but the UI had complex dynamic tables. Task: still deliver what the sprint needed. Action: I told the lead early on day two, proposed automating the API checks first and the UI flows next sprint, and documented the extra effort. Result: the sprint goal was met, and I now spike unfamiliar screens before estimating.
29

Your company is debating a cloud device farm versus an in-house device lab. How do you advise?

Save to ▾
Show answer
A cloud farm gives hundreds of device and OS combinations, parallel capacity and no hardware maintenance, but costs per minute, adds network latency and may raise data privacy concerns. An in-house lab is cheaper over time for a small fixed set of devices and gives full control, but needs USB hubs, OS updates, battery care and someone to maintain it. Many teams keep a few local devices for debugging and use the cloud for wide coverage.
30

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

Your code review shows a test class with 30 copy-pasted lines in every method. How do you refactor it with Java features?

Save to ▾
Show answer
Extract repeated steps into private helper methods or a page object, move common setup into @BeforeMethod, and use a DataProvider when only data differs. If the repeated code differs only in a small action, pass that action as a lambda, such as a Consumer<WebDriver>. Rerun the tests after each small refactor to confirm behaviour is unchanged.
32

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

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

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

How do you retry failed tests in TestNG?

Save to ▾
Show answer
Implement IRetryAnalyzer with a retry count and attach it through the test annotation or a listener to rerun flaky tests.
36

Reverse a string in Java.

Save to ▾
Show answer
String r = new StringBuilder(s).reverse().toString(); // or loop from the last index and append each character
37

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

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

How do you handle pressure when management wants 100 percent automation coverage?

Save to ▾
Show answer
Situation: leadership set a goal to automate every manual test case. Task: set realistic expectations. Action: I analysed the cases, showed that some were one-time, visual or exploratory, and proposed covering critical and repetitive flows first with a clear ROI estimate. Result: we agreed on 80 percent of regression cases, delivered it on time, and kept exploratory testing manual.
40

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.

Frequently asked questions

What does a Mobile Automation Tester do?

Automates functional and regression tests for Android and iOS apps using Appium with Java, TestNG and the Page Object Model. Works on emulators, real devices and cloud device farms, handles gestures, permissions and hybrid webviews, and runs suites in CI. Interviews test Appium architecture and capabilities, mobile locator strategies, gestures with W3C Actions, parallel device runs and how you debug failures that appear only on specific devices.

Which skills are tested in a Mobile Automation Tester interview?

Expect questions on Appium 2, Core Java, Mobile locators and gestures, TestNG and POM, Device farms and CI. Most rounds also ask you to explain a project and solve one practical problem live.

How do I prepare for a Mobile Automation Tester interview?

Revise Appium Mobile Automation, Core Java for Testers, Page Object Model, TestNG Framework first using the topic sheets, practise the questions on this page aloud, then do one full mock interview to practise timing.