Robot Framework supports mobile automation through the AppiumLibrary, which acts as a bridge to the Appium Server. This allows automation of Android and iOS apps, whether they are native, hybrid, or mobile web applications.
Tip for beginners: Before starting with Robot Framework mobile automation, it is recommended to go through a basic Appium tutorial to understand mobile application automation concepts.
Appium tutorial link: https://www.qafeast.com/appium
1. Setup Requirement
Install Required Tools
- Python (latest version)
- Robot Framework: pip install robotframework
- AppiumLibrary: pip install robotframework-appiumlibrary
- Appium Server
- Install Nodejs: npm install -g appium
- Start Appium Server: appium
- Android SDK / ADB
- Install Android Studio and configure ANDROID_HOME environment variable.
- Make sure your device is detected: adb devices
- Device or Emulator
- You can use a real Android device or an emulator from Android Studio.
2. Desired Capabilities
Desired capabilities tell Appium which device, platform, and application to automate.
Example – Android Configuration
REMOTE_URL → Appium server endpoint
PLATFORM → Mobile OS (Android or iOS)
DEVICE_NAME → Device ID or emulator name
APP_PACKAGE / APP_ACTIVITY → Identifiers for Android apps
3. Writing the First Mobile Test
Example – Launch and Validate Calculator App
Test Flow Explanation:
- Connects to the Appium Server
- Opens the Calculator app on the Android device
- Clicks the digits and operator buttons
- Retrieves and verifies the calculation result
- Closes the app session
4. Common Mobile Automation Keywords
Below are frequently used AppiumLibrary keywords:
|
Keyword |
Description |
|
Open Application |
Launches an app using desired capabilities |
|
Click Element |
Taps on a button or UI element |
|
Input Text |
Enters text in an input field |
|
Get Text |
Retrieves text displayed on screen |
|
Swipe |
Swipes across the screen (useful for scrolling) |
|
Wait Until Page Contains |
Waits for an element or text to appear |
|
Close Application |
Closes the currently opened app |
|
Capture Page Screenshot |
Captures a screenshot for debugging |