Mobile App Testing Patterns
Mobile native app testing in KaneAI follows many of the same principles as web testing, but with platform-specific nuances for Android and iOS. This guide covers the patterns, workarounds, and best practices that will help you write reliable mobile app tests.
Getting Started with Mobile Tests
- Navigate to the KaneAI home page
- Choose App Test (Android or iOS)
- Select a real device from the device cloud
- Upload your app (APK for Android, IPA for iOS) or select a previously uploaded app
- Start authoring with natural language instructions
Keyboard Handling
The keyboard is one of the biggest differences between web and mobile testing. On mobile, the on-screen keyboard persists after typing and can block elements below it.
Android
The keyboard typically auto-dismisses on most interactions, but you can explicitly dismiss it:
hide keyboard
iOS
iOS keyboards are more persistent. The best approach is to use press Enter after typing, which both submits the current field and dismisses the keyboard:
type "[email protected]" in the email field and press Enter
Alternatively, if the keyboard has a "Done" or "Cancel" button:
click on "Done" button on the keyboard
click on "Cancel" button on the keyboard
If you skip keyboard dismissal on iOS, the keyboard may cover the next element you need to interact with, causing the step to fail. Always dismiss the keyboard before moving to the next field.
Scenario: Login Form on iOS
type "[email protected]" in the email field and press Enter
type "password123" in the password field and press Enter
click on the "Sign In" button
wait for 5 seconds
assert "Welcome" is visible
OTP & PIN Fields
Mobile apps frequently use individual digit boxes for OTP entry. Use the OTP keyword — KaneAI automatically distributes digits across the boxes.
enter OTP "123456"
enter OTP "7890"
Do not type into each box individually. The OTP keyword handles multi-box distribution.
Scenario: SMS OTP Verification
type "+1-555-0123" in the phone number field and press Enter
click on "Send Code"
wait for 10 seconds
enter OTP "654321"
click on "Verify"
assert "Phone verified" is visible
Scrolling on Mobile
Mobile scrolling works differently from web — there's no pixel-based scroll. Use count-based or directional scrolling.
scroll down 3 times
scroll up 2 times
scroll down 1 time