Automation Testing Mobile Test Automation 2 — Questions and Answers
Question 1: What is the purpose of Appium's desired capabilities in test configuration?
- To specify the platform, app, and device settings for the Appium session (Correct answer)
- To define test assertions
- To configure network throttling
- To set up CI/CD integration
Correct answer: To specify the platform, app, and device settings for the Appium session
Desired capabilities are a set of key-value pairs that tell the Appium server which platform, device, and app to use when starting an automation session.
Question 2: Which gesture does Appium's TouchAction class support for mobile testing?
- Swipe, tap, long press, and pinch (Correct answer)
- Mouse click and keyboard input only
- Drag and drop on web only
- Screenshot capture
Correct answer: Swipe, tap, long press, and pinch
Appium's TouchAction API supports mobile-specific gestures including swipe, tap, long press, pinch, and zoom.
Question 3: What does 'cloud device farm' provide for mobile test automation?
- Access to a large pool of real physical devices hosted in the cloud for testing (Correct answer)
- Virtual device emulation only
- Mobile app build services
- CI/CD pipeline management
Correct answer: Access to a large pool of real physical devices hosted in the cloud for testing
Cloud device farms (like AWS Device Farm or BrowserStack) provide access to hundreds of real physical devices for running automated tests remotely.
Question 4: In mobile automation, what does 'context switching' in Appium mean?
- Switching between NATIVE_APP and WEBVIEW contexts to interact with hybrid app layers (Correct answer)
- Switching between iOS and Android
- Switching test frameworks mid-run
- Switching between portrait and landscape mode
Correct answer: Switching between NATIVE_APP and WEBVIEW contexts to interact with hybrid app layers
Appium context switching allows tests to toggle between native UI elements and embedded WebViews within hybrid mobile apps.
Question 5: What is UI Automator used for in Android test automation?
- Cross-app Android UI testing including system apps and notifications (Correct answer)
- iOS UI testing
- Backend service testing
- Database testing on Android
Correct answer: Cross-app Android UI testing including system apps and notifications
Android's UI Automator framework supports interaction with system-level UI elements and cross-app testing that Espresso cannot access.
Question 6: What does the mobile keyword 'contentDescription' correspond to in Appium locators?
- The Android accessibility label used as an accessibility ID locator in Appium (Correct answer)
- A CSS class attribute
- An iOS-specific element tag
- A network resource identifier
Correct answer: The Android accessibility label used as an accessibility ID locator in Appium
Android's contentDescription attribute provides a text label for accessibility and serves as the accessibility ID in Appium for locating elements.
What is the purpose of Appium's desired capabilities in test configuration?