Updated recently
Last updated:
Quick Answer: Appium is an open-source mobile test automation framework that uses the WebDriver protocol to test iOS and Android native, hybrid, and mobile web applications. To start: install Node.js, install Appium CLI, set up Android Studio, and write your first test.
What is Appium?
Appium is an open-source tool for automating mobile applications on iOS, Android, and Windows. It uses the WebDriver protocol, supports Java, Python, JavaScript, Ruby, and C#, and tests native, hybrid, and mobile web apps without modifying the application source code.
Prerequisites
- Node.js 18+ installed
- Java JDK 11+ installed
- Android Studio (for Android) or Xcode (for iOS)
- A code editor (VS Code or IntelliJ IDEA)
Step 1: Install Appium
# Install Appium globally
npm install -g appium
# Verify installation
appium --version
# Install Appium Doctor
npm install -g @appium/doctor
appium-doctor --android
Step 2: Set Up Android Emulator
- Open Android Studio, SDK Manager
- Install Android SDK Platform 33+ and Intel HAXM
- Create AVD: Device Manager, Create Device, Pixel 6, API 33
- Start emulator, verify with adb devices
Step 3: Start the Appium Server
# Start Appium on default port 4723
appium
Step 4: Write Your First Appium Test (Java)
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.options.UiAutomator2Options;
import org.junit.jupiter.api.*;
public class FirstAppiumTest {
static AndroidDriver driver;
@BeforeAll
static void setup() {
UiAutomator2Options options = new UiAutomator2Options();
options.setPlatformName("Android");
options.setDeviceName("Pixel_6_API_33");
options.setApp("/path/to/app.apk");
options.setAutomationName("UiAutomator2");
driver = new AndroidDriver(options);
}
@Test
void testAppLaunch() {
String packageName = driver.getCurrentPackage();
Assertions.assertEquals("com.example.myapp", packageName);
}
@AfterAll
static void teardown() {
if (driver != null) driver.quit();
}
}
Step 5: Find Elements on Mobile
| Locator Strategy | Example | When to Use |
|---|---|---|
| By ID | findElement(By.id(“com.example:id/login”)) | Unique resource-id |
| By XPath | findElement(By.xpath(“//android.widget.Button[@text=’Login’]”)) | Text-based or complex hierarchies |
| By Accessibility ID | findElement(By.accessibilityId(“login-button”)) | Cross-platform friendly |
Common Appium Interview Topics
- Desired capabilities vs Appium options
- UiAutomator2 vs Espresso vs XCUITest engines
- Handling native alerts and keyboard interactions
- Swiping, scrolling, and gesture-based testing
- Testing hybrid apps (WebView context switching)
Get Started
Master mobile automation with SkilBrill Selenium Training covering WebDriver foundations, then extend to Appium.
FAQ
Do I need a real device to learn Appium?
No. Android emulators and iOS simulators are sufficient for learning.
Is Appium free?
Yes. Appium is completely open-source and free.
