Appium Junior cheat sheet: interview answers
Every question of this level with its correct answer and explanation, on one page for a quick review before the interview.
1. What is Appium?
Correct answer: An open-source tool that automates mobile and desktop apps via the WebDriver protocol
Appium exposes a WebDriver-compatible server, so tests written in Java, Python, JS and others can drive apps.
2. What app types can Appium automate on mobile?
Correct answer: Native, hybrid and mobile web apps
Native apps use platform UI frameworks, hybrid apps embed WebViews, and mobile web runs in the browser.
3. What is an Appium driver in Appium 2?
Correct answer: A separately installed package that automates one platform, like UiAutomator2
Appium 2 split drivers out of the core. You install them with
appium driver install uiautomator2.4. Which driver is the usual choice for Android native apps?
Correct answer: UiAutomator2
UiAutomator2 is built on Google's UI Automator framework. Espresso is another Android option.
5. Which driver automates iOS apps?
Correct answer: XCUITest
XCUITest uses Apple's XCTest framework through WebDriverAgent on the device or simulator.
6. How do you install a driver in Appium 2?
Correct answer:
appium driver install uiautomator2Drivers and plugins are managed by the Appium CLI.
appium driver listshows what's installed.7. What are capabilities in an Appium session?
Correct answer: Settings sent when creating a session, like platform, device and app
Appium-specific capabilities use the
appium:prefix, like appium:deviceName and appium:app.8. Which capability tells Appium which driver to use?
Correct answer:
appium:automationName, e.g. UiAutomator2platformName chooses the platform; automationName chooses the driver for it.
9. What does
appium:apppoint to?Correct answer: The path or URL of the app file to install, like an .apk or .ipa
Alternatively, use appPackage and appActivity on Android or bundleId on iOS to start an installed app.
10. What are
appPackageandappActivityon Android?Correct answer: The app's package name and the activity to start
For example com.example.shop and .MainActivity. They start an app that is already installed.
11. What is
bundleIdon iOS?Correct answer: The unique identifier of the app, like com.example.shop
With bundleId Appium launches an installed app without reinstalling it.
12. What does Appium Inspector help with?
Correct answer: Viewing the app's element tree and trying locators
Inspector connects to an Appium server, shows a screenshot, the XML tree and element attributes.
13. Which locator is usually the most stable in mobile tests?
Correct answer: Accessibility id
Accessibility id maps to content-desc on Android and accessibilityIdentifier on iOS.
14. What does accessibility id map to on Android?
Correct answer: The element's content-desc attribute
Developers set contentDescription. resource-id is another good locator via By.id.
15. What does accessibility id map to on iOS?
Correct answer: The element's accessibilityIdentifier
accessibilityIdentifier is meant for testing and is not read by VoiceOver, unlike accessibilityLabel.
16. Why is XPath often slow in Appium tests?
Correct answer: The driver must build the whole UI tree as XML for each search
On big screens this can take seconds. Prefer accessibility id or platform-native locators.
17. Which Android-specific locator strategy uses UI Automator's selectors?
Correct answer:
-android uiautomator, e.g. new UiSelector().text("OK")It runs on the device and can also scroll with UiScrollable.
18. Which iOS-specific locator strategies are faster than XPath?
Correct answer: iOS predicate string and iOS class chain
Predicates like
label == "Login"are evaluated natively by XCTest.19. What is a real device versus an emulator or simulator?
Correct answer: A physical phone versus a virtual device running on a computer
Emulators (Android) and simulators (iOS) are cheap and fast; real devices show real performance and hardware.
20. Why must tests run on real devices too, not only emulators?
Correct answer: Hardware, performance, sensors and OEM changes differ on real phones
Camera, biometrics, push notifications and vendor skins are only realistic on devices.
21. What is adb?
Correct answer: Android Debug Bridge, a CLI to talk to Android devices
adb installs apps, reads logs (logcat), runs shell commands and lists devices with
adb devices.22. How do you see which Android devices are connected?
Correct answer:
adb devicesThe serial from this list goes into the udid capability when several devices are attached.
23. What does the
appium:udidcapability select?Correct answer: A specific device by its unique id
Without it Appium picks the first available device, which is risky in parallel runs.
24. What is a native context versus a WebView context?
Correct answer: The app's native UI versus web content inside the app
Hybrid apps have NATIVE_APP and WEBVIEW_x contexts. Switch to use web locators like CSS.
25. How do you switch to a WebView in a hybrid app?
Correct answer: Get the context handles and switch to the WEBVIEW context
In Java:
driver.context("WEBVIEW_com.example"). The WebView must be debuggable.26. How do you tap an element in Appium?
Correct answer: Find it and call click()
click() works like a tap. For precise gestures use W3C actions or driver extensions.
27. How do you type into a text field?
Correct answer: Find the field and call sendKeys
Appium types through the driver; hiding the keyboard afterwards may be needed.
28. Why may a test need to hide the keyboard?
Correct answer: The on-screen keyboard can cover the next element to tap
Use driver.hideKeyboard() or tap outside the field, depending on the platform.
29. What are W3C actions used for in Appium?
Correct answer: Gestures like swipe, long press and multi-finger moves
Pointer actions with type touch describe finger moves step by step. TouchAction is deprecated.
30. Which gesture API from Appium 1 is deprecated in Appium 2?
Correct answer: TouchAction and MultiTouchAction
Use W3C actions or driver-specific commands like
mobile: swipeGesture.31. How do you scroll to an element on Android with UiAutomator2?
Correct answer: Use UiScrollable in an
-android uiautomatorlocatornew UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(...) scrolls until it finds the element.
32. What does
driver.terminateApp(id)do?Correct answer: Stops the running app
activateApp brings it back; removeApp uninstalls.
33. What does
noReset: truechange?Correct answer: App data isn't cleared between sessions
Faster runs, but state leaks between tests. fullReset reinstalls the app instead.
34. What does
fullReset: truedo?Correct answer: Uninstalls and reinstalls the app for a clean state
It's slow but gives a clean start. Many suites clear app data via API instead.
35. Why are explicit waits important in mobile tests?
Correct answer: Screens load, animate and fetch data at varying speeds
WebDriverWait with conditions like visibility avoids Thread.sleep and flaky failures.
36. What does
autoGrantPermissionsdo on Android?Correct answer: Grants the app's runtime permissions on install
Without it, system permission dialogs appear and must be handled in tests.
37. How should a test handle an iOS system alert like 'Allow notifications'?
Correct answer: Accept it via alert handling or set autoAcceptAlerts
XCUITest can accept or dismiss alerts with driver commands or capabilities.
38. What is a deep link?
Correct answer: A URL that opens a specific screen inside the app
Tests open deep links to skip navigation steps and reach a screen directly.
39. How do you take a screenshot in Appium?
Correct answer: Call getScreenshotAs, as in Selenium
Attach screenshots on failure, like in web tests.
40. What is logcat?
Correct answer: The Android system log, read with adb logcat
Logcat shows crashes, exceptions and app logs. Save it on failures.
41. What does
platformNamespecify?Correct answer: The target platform, like Android or iOS
It's a standard W3C capability, without the appium: prefix.
42. Which languages can you write Appium tests in?
Correct answer: Any with a WebDriver client: Java, Python, JS, C#, Ruby
Appium is a server. Clients like the Java client or WebdriverIO talk to it over HTTP.
43. What is the Appium Java client?
Correct answer: A library with AndroidDriver, IOSDriver and Appium extensions
It builds on Selenium's Java bindings and adds mobile commands.
44. Which class do you create for an Android session in the Java client?
Correct answer:
AndroidDriverwith options and the server URLOptions classes like UiAutomator2Options build capabilities in a typed way.
45. What is the default port of the Appium server?
Correct answer: 4723
Start with
appium, then connect to http://127.0.0.1:4723. Selenium Grid uses 4444 by default.46. Which runtime does the Appium 2 server need?
Correct answer: Node.js
Install with
npm i -g appium. Android drivers also need the Android SDK and Java.47. What does
appium-doctor(or driver doctor) check?Correct answer: That SDKs, environment variables and tools are set up
In Appium 2 drivers provide
appium driver doctor <name>.48. What is the main difference between UiAutomator2 and Espresso drivers?
Correct answer: Espresso runs inside the app process and syncs with the UI thread
Espresso is often more stable for one app; UiAutomator2 can also reach other apps and system UI.
49. What does WebDriverAgent do in iOS automation?
Correct answer: Runs on the device and executes XCTest commands for Appium
WebDriverAgent must be built and signed for real iPhones.
50. Why do real iOS devices need code signing for tests?
Correct answer: WebDriverAgent must be signed to run on the device
A development team and provisioning profile are needed. Simulators don't require this.
51. What is the Page Object pattern in mobile tests?
Correct answer: A class per screen that hides locators behind methods
The same idea as on the web. Screens may differ per platform, so some teams have per-platform locators.
52. How can one page object support Android and iOS?
Correct answer: Use per-platform locators, e.g. @AndroidFindBy and @iOSXCUITFindBy
Java client annotations pick the right locator for the running platform.
53. What does
driver.getPageSource()return in Appium?Correct answer: The current UI tree as XML
Saving it on failure shows what was on screen and which attributes elements had.
54. Why should mobile tests set a known device orientation?
Correct answer: Layouts change between portrait and landscape
Set orientation in capabilities or at the start of the test.
55. What does
driver.runAppInBackground(Duration)test?Correct answer: How the app handles going to the background and back
Apps must keep state after interruptions. Bugs often hide in onPause and onResume.
56. Why are interruptions like calls and notifications worth testing?
Correct answer: They pause the app and can break its state
Lifecycle bugs show up as lost input or crashes after resuming.
57. What is a mobile web test with Appium?
Correct answer: Driving Chrome or Safari on a phone to test a website
Set browserName to Chrome or Safari instead of an app capability.
58. What problem does a mobile device cloud solve?
Correct answer: Access to many real devices without buying them
Clouds offer many models and OS versions; costs and queue times are the trade-off.
59. Why should mobile tests avoid tapping by screen coordinates?
Correct answer: Positions change with screen size, density and layout
Locate elements instead; use coordinates only for gestures relative to an element.
60. What does
isDisplayed()check in a mobile test?Correct answer: Whether the element is visible on the screen
Off-screen list items may exist in the tree but not be displayed.
61. Why may an element in a long list not be found?
Correct answer: It's not rendered until you scroll to it
RecyclerView and UITableView render visible rows only. Scroll first.
62. What does
resource-idlook like on Android?Correct answer:
com.example.shop:id/login_buttonFind it with By.id. It comes from the view's android:id in layouts.
63. How do you check the app's text on a label?
Correct answer: Find the element and call getText()
On iOS getText usually returns the label or value attribute.
64. What is a flaky mobile test?
Correct answer: A test that passes or fails randomly without code changes
Common causes: animations, missing waits, slow devices, shared data and system dialogs.
65. Why disable animations on Android test devices?
Correct answer: They slow tests and cause timing failures
Developer options or adb settings set animation scales to 0.
66. What does
appium:newCommandTimeoutcontrol?Correct answer: How long the server waits for a command before ending the session
If a test pauses longer, the session closes. Set it higher for debugging.
67. What should a test do in teardown?
Correct answer: Quit the driver so the session and device are freed
Leftover sessions block devices for the next tests.
68. How do you get the app's current Android activity?
Correct answer:
driver.currentActivity()Useful to assert navigation landed on the expected screen.
69. What does an Appium plugin do?
Correct answer: Extends the server with features like image locators
Install with
appium plugin install images, then enable with --use-plugins.70. Why test on several OS versions?
Correct answer: Behavior, permissions and UI differ between versions
Pick versions from user analytics: the most used plus the oldest supported.
71. What is a hybrid app?
Correct answer: A native shell that shows web content in a WebView
Cordova, Ionic and many in-app pages are hybrid. Tests switch contexts.
72. What does
getContextHandles()return?Correct answer: The available contexts, like NATIVE_APP and WEBVIEW
If a WebView context is missing, the WebView may not be debuggable.
73. Why is test data important in mobile tests too?
Correct answer: Shared accounts and data make tests collide
Create users via API per test; log in fast via deep link or API token if the app allows.
74. What is the benefit of starting tests on a deep-linked screen?
Correct answer: Shorter, faster tests that focus on one feature
Navigating through five screens in every test costs time and adds failure points.
75. Why should UI tests on mobile be fewer than unit tests?
Correct answer: They're slow, need devices and break more often
Use the test pyramid: many unit and API tests, a focused set of UI flows.