Automation Tools
Appium & Mobile Interview Questions & Answers
Appium and mobile automation interview questions on Appium 2 architecture, UiAutomator2 and XCUITest drivers, capabilities, locators, W3C gestures, hybrid apps and real-device clouds.
Interview Questions
Showing 15 of 40 questions
Appium is an open-source tool that automates native, hybrid and mobile web apps on Android and iOS using the W3C WebDriver protocol. You write tests in any language with a WebDriver client, and the same API style works across platforms.
Appium 2 is a Node.js server that exposes the W3C WebDriver API, while platform support lives in separately installed drivers such as UiAutomator2 and XCUITest. The client sends HTTP commands to the server, which routes them to the driver, which talks to the device's native automation framework.
Appium 2 decoupled drivers and plugins from the core, dropped the old JSON Wire Protocol in favour of W3C WebDriver only, and changed the default base path from /wd/hub to /. Non-standard capabilities now need the appium: vendor prefix.
Install the server with npm, then install the drivers you need with the appium driver command. appium-doctor or the driver's doctor command checks prerequisites like the Android SDK, JAVA_HOME and Xcode.
UiAutomator2 is the standard Appium driver for Android. It installs a server APK on the device that uses Google's UiAutomator framework to find elements and perform actions on any app.
XCUITest is Appium's iOS driver built on Apple's XCTest framework. It uses WebDriverAgent, an app installed on the simulator or device, to execute commands, and requires a Mac with Xcode.
Capabilities are key-value settings sent when creating a session that tell Appium which platform, driver, device and app to use. Key ones are platformName, appium:automationName, appium:deviceName, appium:app or appPackage/appActivity, and appium:udid for a specific device.
Use an options class like UiAutomator2Options to set capabilities and pass it with the server URL to AndroidDriver. In Appium 2 the URL is http://127.0.0.1:4723 without /wd/hub unless the server was started with a base path.
noReset true keeps the app installed and its data intact between sessions, which is fast. fullReset true uninstalls the app and clears data before and after the session for a clean state. With both false (default), Appium clears app data but doesn't uninstall on Android.
Open the app on the device and run adb shell dumpsys window to see the focused activity, or use aapt dump badging on the APK. The package is the app ID and the activity is the screen to launch.
Appium supports accessibility id, id (resource-id on Android), class name, XPath, and platform-specific ones like UiAutomator selectors and iOS predicate strings or class chains. Accessibility id is the preferred choice because it is fast and cross-platform.
Appium has to fetch and parse the entire UI hierarchy as XML for each XPath query, which is slow, particularly on iOS with large screens. XPath also breaks easily when layouts change.
AppiumBy.androidUIAutomator takes a Java UiSelector expression executed on the device. UiScrollable with scrollIntoView scrolls a list until the matching element is visible.
They are native iOS locator strategies executed by XCTest, so they are much faster than XPath. Predicate strings filter by attributes like name, label or value, and class chains are a simplified hierarchical path with optional predicates.
Appium Inspector is a desktop or web app that connects to an Appium server with capabilities, shows a screenshot and the element tree, and suggests locators. Android Studio's Layout Inspector and uiautomatorviewer are alternatives on Android.