How would you approach test automation for a mobile app on Android and iOS?
What the interviewer wants to hear
- Choose tools: Appium for cross-platform, Espresso/XCUITest for native speed
- Ask developers for accessibility ids
- Emulators for most runs, real device cloud for coverage
- Handle permissions, deep links and app state
- Push logic tests to API and unit level
Model answer
First I check what the developers use. If the team wants one suite for both platforms, Appium with a shared page object layer works well. If speed and stability matter most, native frameworks like Espresso and XCUITest are faster and closer to the code, and developers can own some tests. I ask for accessibility ids on key elements so locators are stable and shared. Most runs happen on emulators and simulators in CI, with a smaller suite on a real device cloud covering the devices and OS versions our analytics show users have. I use deep links and API calls to reach screens quickly instead of tapping through every step, and I handle permission dialogs and app reset between tests. Business logic is covered by API and unit tests, so the mobile UI suite focuses on critical journeys.
Can you answer it under time pressure?
Take a timed medium round and get scored on every answer.
More medium Automation Test Engineer questions
- How would you design a test automation framework from scratch for a web app?
- A test fails randomly in CI about 1 in 20 runs. Walk me through how you find and fix the cause.
- How do you manage test data in an automated suite that runs in parallel on shared environments?
- When should automated tests mock external services, and when should they use real ones?
- How do you make automated test results useful to developers and managers?
- How do you handle authentication in a large UI test suite without making every test log in through the UI?
- Your suite needs to run in parallel across many workers. What do you change to make that safe?
- Describe how you would set up automated tests in a CI/CD pipeline for a web application.
- You are asked to load test a new checkout API before a big sale. How do you plan and run it?