QA Interview Hub · Knowledge base · Quizzes · Українська

All topics

Appium interview questions

30 questions on Appium, from the basics to the hard ones. Answers and explanations are in the quiz and the knowledge base.

By level: Junior QA interview questions · Middle QA interview questions · Senior QA interview questions

Appium architecture

  1. What is Appium? Junior
  2. In Appium 2, how does a Java test on a computer control an app on a device? Junior
  3. Do you need to modify or recompile an app to test it through Appium? Junior
  4. Which capabilities select the driver for a native iOS app in Appium 2? Middle
  5. After npm install -g appium (Appium 2) the session fails with "Could not find a driver for automationName UiAutomator2 and platformName Android". What to do? Junior
  6. In the session JSON the field looks like appium:deviceName. Why is there a prefix and who adds it in this Java code? Junior
    UiAutomator2Options options = new UiAutomator2Options()
        .setDeviceName("Pixel_7")
        .setApp("/builds/app-debug.apk");
  7. What are plugins in Appium 2 and how do they differ from drivers? Middle
  8. The tests never call driver.quit(). What happens to the sessions on the Appium server? Junior

Take the quiz for this chapter · Read the explanation in the knowledge base

Locators and waits

  1. A native app has the same screens on Android and iOS, and developers are ready to add identifiers. Which locator should you pick first? Junior
  2. Which native element attributes does AppiumBy.accessibilityId correspond to? Junior
  3. Which attribute of an Android element does this locator search (UiAutomator2)? Junior
    driver.findElement(AppiumBy.id("com.example.shop:id/login_button"));
  4. Why are XPath locators on mobile (UiAutomator2, XCUITest) considered the last resort? Junior
  5. What does this line do on Android (UiAutomator2)? Middle
    driver.findElement(AppiumBy.androidUIAutomator(
        "new UiScrollable(new UiSelector().scrollable(true))"
            + ".scrollIntoView(new UiSelector().text(\"Settings\"))"));
  6. Which of these locators works only on iOS and runs natively, faster than XPath? Middle
  7. What is Appium Inspector used for? Junior
  8. The Home screen loads in 1 to 8 seconds depending on the API. How do you reliably wait for the title? Junior
    driver.findElement(AppiumBy.accessibilityId("login")).click();
    Thread.sleep(5000);
    String title = driver.findElement(AppiumBy.accessibilityId("home_title")).getText();

Take the quiz for this chapter · Read the explanation in the knowledge base

Mobile specifics

  1. A test opens a site in Chrome on an Android emulator, and there is no .apk. What do you set instead of appium:app? Junior
  2. A hybrid app opened a WebView and the CSS locator throws NoSuchElementException although the field is visible. What is the most likely cause? Junior
    driver.findElement(AppiumBy.accessibilityId("Open site")).click();
    driver.findElement(By.cssSelector("#email")).sendKeys("a@b.c");
  3. getContextHandles() for an Android app returns only [NATIVE_APP] although a WebView is on screen. What to check first? Middle
  4. The swipe example from an old tutorial does not compile with java-client 11. What replaces it? Middle
    new TouchAction<>(driver).press(PointOption.point(500, 1600))
        .moveTo(PointOption.point(500, 400)).release().perform();
  5. On first launch an Android app shows a system camera permission dialog and the test gets stuck. Which UiAutomator2 capability solves this without clicks in the test? Junior
  6. How do you open the order screen in UiAutomator2 with one call, skipping UI navigation? Middle
    driver.executeScript("mobile: deepLink", Map.of(
        "url", "shop://orders/42",
        "package", "com.example.shop"));
  7. What does this call do and why is it used in tests? Junior
    driver.runAppInBackground(Duration.ofSeconds(5));

Take the quiz for this chapter · Read the explanation in the knowledge base

Running and stability

  1. A team chooses between Android emulators and real devices. What are real devices still needed for? Junior
  2. A team wants to run Appium iOS tests on simulators in its own CI. Which requirement cannot be avoided? Junior
  3. Why does a team use a real device cloud (BrowserStack, Sauce Labs) instead of its own fleet? Junior
  4. What does appium:noReset = true mean? Junior
  5. What does this pair of annotations give in a Page Object for two platforms? Middle
    public class LoginPage {
        @AndroidFindBy(accessibility = "login_button")
        @iOSXCUITFindBy(accessibility = "login_button")
        private WebElement loginButton;
    
        public LoginPage(AppiumDriver driver) {
            PageFactory.initElements(new AppiumFieldDecorator(driver), this);
        }
    }
  6. Two Android UiAutomator2 sessions start in parallel on one Appium 2 server, on two emulators with different udids. The second now and then fails with an error about an occupied systemPort. What to configure? Middle
    new UiAutomator2Options().setUdid("emulator-5554").setApp(apk);
    new UiAutomator2Options().setUdid("emulator-5556").setApp(apk);
  7. A test passes locally but in CI on an emulator fails in about every fifth run with NoSuchElementException on a button visible in the screenshot. The locator was verified in Inspector, the build and device are the same. What to check first? Middle

Take the quiz for this chapter · Read the explanation in the knowledge base