Appium Middle 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. 1. What changed in the architecture from Appium 1 to Appium 2?

    Correct answer: Drivers and plugins became separate packages installed on demand

    The core is smaller; you install only the drivers you need and update them on their own schedule.

  2. 2. Why do Appium 2 capabilities need the appium: prefix?

    Correct answer: W3C only allows standard keys without a vendor prefix

    Standard keys like platformName stay unprefixed; Appium-specific ones like deviceName get appium:.

  3. 3. What is the default base path of the Appium 2 server?

    Correct answer: /, while Appium 1 used /wd/hub

    Clients that still use /wd/hub fail until you change the URL or start with --base-path /wd/hub.

  4. 4. What are mobile: execute methods?

    Correct answer: Driver-specific commands called via executeScript, like mobile: swipeGesture

    Drivers expose extra features this way: gestures, shell, permissions, deep links and more.

  5. 5. How do you open a deep link on Android with UiAutomator2?

    Correct answer: mobile: deepLink with the URL and the app package

    It starts an intent with the URL. On iOS, open the URL via Safari or mobile: deepLink where supported.

  6. 6. How do you perform a swipe with W3C actions?

    Correct answer: A touch pointer: move to start, press, move to end, release

    Add a pause between press and move for apps that need slower gestures.

  7. 7. What is a long press in W3C actions?

    Correct answer: Pointer down, a pause of about a second, then pointer up

    UiAutomator2 also offers mobile: longClickGesture.

  8. 8. How can you set app permissions before a test on Android?

    Correct answer: Use autoGrantPermissions or mobile: changePermissions

    Testing the permission flow itself needs the dialog; other tests should skip it.

  9. 9. Why may a WebView context not appear on Android?

    Correct answer: The app's WebView debugging is off in that build

    Debug builds enable WebView.setWebContentsDebuggingEnabled(true). Release builds usually don't.

  10. 10. What does Appium need to automate a WebView on Android?

    Correct answer: A Chromedriver that matches the WebView's Chrome version

    Appium can download matching Chromedrivers automatically with the right server flag.

  11. 11. How do you get the Android log into a test report?

    Correct answer: Read the logcat log type via driver logs and attach it

    driver.manage().logs().get("logcat") returns entries; attach them on failures.

  12. 12. What's the risk of noReset: true in a suite?

    Correct answer: State from one test leaks into the next

    Combine it with clearing app data via mobile: clearApp or API resets when isolation matters.

  13. 13. How do you clear app data on Android without reinstalling?

    Correct answer: mobile: clearApp or adb shell pm clear <package>

    Much faster than fullReset; the app starts as on first launch.

  14. 14. How do you run Appium tests in parallel on several Android devices?

    Correct answer: One session per device, with unique udid and systemPort values

    UiAutomator2 uses systemPort, and each parallel session needs its own.

  15. 15. What does wdaLocalPort do for parallel iOS runs?

    Correct answer: Gives each WebDriverAgent instance its own local port

    Parallel iOS sessions on one Mac need unique WDA ports to avoid clashes.

  16. 16. What is Appium's settings API?

    Correct answer: Changing driver behavior during a session, like waitForIdleTimeout

    driver.setSetting(...) tunes things like idle waits or how XML is built, without a restart.

  17. 17. Why may UiAutomator2 hang while the app shows an animation?

    Correct answer: It waits for the app to become idle before acting

    Lower waitForIdleTimeout in settings for apps with endless animations.

  18. 18. How do you speed up XPath on Android?

    Correct answer: Avoid it, or narrow the tree with settings and short relative paths

    Settings like ignoreUnimportantViews shrink the tree, but locators by id or accessibility id are faster.

  19. 19. What does an iOS class chain locator look like?

    Correct answer: **/XCUIElementTypeButton[label == "Login"]

    Class chains are like simplified XPath but run natively, so they're much faster.

  20. 20. What does an iOS predicate string locator look like?

    Correct answer: type == 'XCUIElementTypeButton' AND name == 'Login'

    It uses NSPredicate syntax: ==, CONTAINS, BEGINSWITH and boolean operators.

  21. 21. What does mobile: scroll or mobile: swipe give over manual W3C swipes?

    Correct answer: Platform-native gestures that are often more reliable

    Native commands use XCTest or UI Automator APIs. W3C actions stay portable across drivers.

  22. 22. How do you test push notifications on a real device?

    Correct answer: Send a push from a test backend, then open the shade and check it

    Android: openNotifications(). iOS: swipe down from the top, or use simulator push commands.

  23. 23. How can a simulator receive a push notification without a server?

    Correct answer: Use xcrun simctl push with a JSON payload

    The XCUITest driver also wraps this for simulators.

  24. 24. Why should mobile tests control network conditions?

    Correct answer: To test offline, slow and flaky network behavior

    Android emulators and some clouds can throttle; iOS has Network Link Conditioner.

  25. 25. How do you test airplane mode on Android?

    Correct answer: Toggle connectivity via driver commands or adb on emulators

    Check that the app shows offline states and syncs when the network returns.

  26. 26. What should a mobile framework capture on failure?

    Correct answer: Screenshot, page source, device logs and a video

    Videos (startRecordingScreen) explain timing issues screenshots can't show.

  27. 27. How do you record a video of the screen during a test?

    Correct answer: startRecordingScreen() and stopRecordingScreen()

    The result is a Base64 video; save it only for failed tests.

  28. 28. What is the role of the Appium Inspector's 'search' feature?

    Correct answer: Checking that a locator finds exactly the expected elements

    Try locators before putting them in code to avoid trial and error in runs.

  29. 29. Why is contentDescription not always ideal as a test id on Android?

    Correct answer: Screen readers read it, so it should be human-readable text

    Prefer resource-id for tests, or agree on clear content descriptions with accessibility in mind.

  30. 30. Why use accessibilityIdentifier rather than accessibilityLabel for tests on iOS?

    Correct answer: The identifier isn't read aloud and stays stable across languages

    Labels are user-facing and translated; identifiers are for automation.

  31. 31. How do you handle a native date picker on iOS?

    Correct answer: Find its wheels and sendKeys the value to each wheel

    XCUIElementTypePickerWheel accepts values via sendKeys.

  32. 32. What does appium:autoWebview do?

    Correct answer: Starts the session directly in the WebView context

    Useful for apps that are almost entirely web content.

  33. 33. What's a common cause of SessionNotCreatedException on Android?

    Correct answer: Wrong app path, missing driver or a device not visible to adb

    Check adb devices, installed drivers and the appium logs from session start.

  34. 34. How do you test that the app keeps state after rotation?

    Correct answer: Enter data, rotate the device, then check the data is still there

    On Android, rotation recreates the activity; lost input is a classic bug.

  35. 35. Why are emulators preferred for most CI runs?

    Correct answer: They're cheap, fast to reset and easy to scale in parallel

    Run the bulk on emulators and key flows on a real device matrix.

  36. 36. How can you start an Android emulator headless in CI?

    Correct answer: emulator -avd <name> -no-window

    Wait for boot completion with adb wait-for-device and a boot-completed check.

  37. 37. What is Espresso driver's main limitation compared to UiAutomator2?

    Correct answer: It can't interact with other apps or system UI outside the app

    Permission dialogs and the notification shade need UiAutomator2 or adb workarounds.

  38. 38. Why may the Espresso driver need the app's source or a rebuild?

    Correct answer: It instruments the app and must match its build, signing and libraries

    Mismatched Kotlin or Compose versions can break the instrumentation server.

  39. 39. How can Appium test Flutter apps?

    Correct answer: With the Flutter driver or the Flutter integration driver plugin

    Flutter draws its own widgets; native trees show little, so Flutter-aware drivers use semantic keys.

  40. 40. What's a typical problem with React Native apps in Appium?

    Correct answer: Missing testID props, so elements lack stable identifiers

    testID maps to resource-id or accessibilityIdentifier. Ask developers to add it.

  41. 41. Why might a test pass on one Android vendor and fail on another?

    Correct answer: Vendor skins change system dialogs, keyboards and behavior

    Samsung, Xiaomi and others change permission dialogs and battery optimizations.

  42. 42. How should tests handle the soft keyboard on Android?

    Correct answer: Hide it when it covers elements, or set unicodeKeyboard options if needed

    Keyboard state affects layouts; some apps resize when it opens.

  43. 43. What's the advantage of WebdriverIO's Appium service?

    Correct answer: It starts and stops the Appium server for the test run

    It's handy locally and in CI; you still configure capabilities per device.

  44. 44. How can you reach a screen behind login quickly in mobile tests?

    Correct answer: Log in via API and pass a token through a deep link or test hook

    Keep a few UI login tests; everything else starts authenticated.

  45. 45. How do you install an app built in CI on the test device?

    Correct answer: Pass the artifact path to the app capability or use installApp

    Pin each run to a specific build artifact for reproducible results.

  46. 46. How do you check the installed app version on Android?

    Correct answer: adb shell dumpsys package <package> and read versionName

    Record it in reports, so failures map to a build.

  47. 47. Why should locators be stored per platform when UIs differ?

    Correct answer: Android and iOS screens often use different structures and ids

    Shared business methods, platform-specific locators: the page object hides the difference.

  48. 48. What does @AndroidFindBy(accessibility = "login") do in the Java client?

    Correct answer: Locates the element by accessibility id on Android

    PageFactory with AppiumFieldDecorator initializes these fields.

  49. 49. How do you wait for an element to disappear, e.g. a loader?

    Correct answer: WebDriverWait with invisibilityOfElementLocated

    Then wait for the content you need. Loaders may flash too quickly to see first.

  50. 50. Why are implicit waits risky in Appium suites?

    Correct answer: Negative checks wait the full timeout and slow the suite

    Set implicit waits to zero and use explicit waits for specific states.

  51. 51. How can tests reduce flakiness from slow device boots in CI?

    Correct answer: Pre-boot emulators and check readiness before starting sessions

    Snapshot-based emulators boot faster and start from a known state.

  52. 52. What do mobile: shell commands need on the Appium server?

    Correct answer: The adb_shell insecure feature enabled when starting the server

    Start with --allow-insecure=uiautomator2:adb_shell or similar. Keep it off on shared servers.

  53. 53. How do you change device location in tests?

    Correct answer: setLocation with latitude and longitude, or emulator geo commands

    Grant location permission and test denied states separately.

  54. 54. How can you test biometric login on a simulator or emulator?

    Correct answer: Use driver commands to enroll and match a fake fingerprint or Face ID

    XCUITest offers mobile: enrollBiometric and sendBiometricMatch; emulators support fingerprint commands.

  55. 55. Why keep app builds for testing with test-only features?

    Correct answer: Debug or QA builds expose hooks, debuggable WebViews and test ids

    Also test the release build in smoke runs, since build settings can change behavior.

  56. 56. How do you check a toast message on Android?

    Correct answer: UiAutomator2 can find toasts via XPath on the toast's text

    Toasts vanish quickly; wait for them right after the action.

  57. 57. What is appium:systemPort in UiAutomator2?

    Correct answer: The local port for the UiAutomator2 server on the device

    Each parallel session on one machine needs a different systemPort.

  58. 58. What does appium:wdaLaunchTimeout help with?

    Correct answer: Waiting longer for WebDriverAgent to start on slow devices

    First WDA builds on real devices can take minutes. usePrebuiltWDA saves time.

  59. 59. Why prebuild WebDriverAgent in CI?

    Correct answer: Building it per session is slow; a prebuilt one starts in seconds

    Build once per Xcode version and device type, then reuse it.

  60. 60. How do you take a screenshot of just one element?

    Correct answer: Call getScreenshotAs on the element

    Element screenshots help in visual checks of components.

  61. 61. Why should mobile tests handle onboarding and 'What's new' screens centrally?

    Correct answer: They appear unpredictably and block the screens tests expect

    Skip them via flags, preferences or a helper that dismisses them once.

  62. 62. What's a good approach to test analytics events from a mobile app?

    Correct answer: Capture them through a proxy or a debug endpoint and assert on them

    A proxy like Charles or a test analytics sink shows what the app sends.

  63. 63. How do you test that the app handles low memory or process death on Android?

    Correct answer: Background the app, kill its process via adb, then reopen it

    Apps must restore state after being killed in the background.

  64. 64. What's a reasonable device matrix for a mobile app?

    Correct answer: Most-used models and OS versions plus the oldest supported

    Base the matrix on user analytics and update it each quarter.

  65. 65. Why log the Appium server output in CI?

    Correct answer: Server logs show driver errors and slow commands behind failures

    Start with --log-timestamp and save the file as a build artifact.

  66. 66. What does getDeviceTime() help with?

    Correct answer: Checking or debugging time-dependent behavior on the device

    Device time differs from CI time zones; tests with dates should account for it.

  67. 67. How do you check which app is in the foreground on iOS?

    Correct answer: mobile: activeAppInfo

    currentActivity is Android-only; iOS uses bundle ids.

  68. 68. What's the use of queryAppState?

    Correct answer: Checking whether the app is not running, in background or in foreground

    Useful after backgrounding or deep links to confirm the app's state.

  69. 69. Why may tests fail after an OS update on devices?

    Correct answer: System dialogs, permissions and driver support can change

    Update drivers and check release notes; run a canary job on new OS versions.

  70. 70. What's the purpose of tagging mobile tests by platform?

    Correct answer: Running Android-only or iOS-only subsets cleanly

    Some features differ per platform; tags keep runs and reports clear.

  71. 71. Why prefer IDs from developers over generated XPath from Inspector?

    Correct answer: Generated XPath ties tests to the layout and breaks easily

    Inspector suggests locators; choose the stable ones, not the first one shown.

  72. 72. How do you test a 'pull to refresh' gesture?

    Correct answer: A touch swipe down from the top of the list, then wait for new data

    Start the gesture inside the scrollable area, with a pause before moving.

  73. 73. What does driver.activateApp(id) do?

    Correct answer: Brings an installed app to the foreground, starting it if needed

    Pair it with terminateApp to restart an app without a new session.

  74. 74. How do you lock and unlock a device in a test?

    Correct answer: Use driver.lockDevice() and unlockDevice() commands

    Lock screens test that the app pauses and resumes correctly.

  75. 75. Why may getText() return an unexpected value on iOS?

    Correct answer: It reads label or value, which may differ from what's shown

    Inspect the element's attributes and assert on the one that carries the text.