---Advertisement---

Selendroid Tutorial for Beginners: Automate Android App Testing with Ease Best 2025

By Manisha

Updated On:

---Advertisement---
Selendroid Tutorial for Beginners

Table of Contents

  1. What is Selendroid?
  2. Why Use Selendroid for Android Testing?
  3. Selendroid Architecture
  4. Getting Started with Selendroid
  5. How to Launch Selendroid
  6. Selendroid Basic Commands
  7. Create Your First Selendroid Test Script
  8. Summary

Selendroid Tutorial for Beginners: Selendroid is a powerful test automation framework designed for native, hybrid, and mobile web Android applications. It supports writing test cases using Selenium 2 client APIs and integrates smoothly with existing Selenium infrastructure. Selendroid can run on both real devices and emulators, making it a versatile tool for mobile automation.


Selendroid Tutorial for Beginners: Selendroid comes packed with advanced features:

  • No app modification required for testing.
  • Tests can run across multiple devices simultaneously.
  • Simulates real-user interactions: touch, swipe, drag & drop.
  • Supports Android API versions from 10 to 19.
  • Hot plug-in support for devices without restarting the server.
  • Built-in Selendroid Inspector Tool for identifying UI elements.

Selendroid Tutorial for Beginners: Selendroid consists of four main components:

  1. WebDriver Client – Based on Selenium Java Client API.
  2. Selendroid-Server – Embedded in the app under test.
  3. Android Driver App – Tests web view content in mobile browsers.
  4. Selendroid-Standalone – Handles server setup and app installation.

Selendroid relies on Android’s Instrumentation framework and Selenium’s WebDriver API for seamless integration.


βœ”οΈ Prerequisites:

  • Java JDK (1.6 or higher)
  • Android SDK (with AVD or real device)
  • Selendroid Standalone & Selendroid Client
  • Selenium WebDriver Libraries
  • Eclipse IDE

System Environment Variables:

Selendroid Tutorial for Beginners: Set up environment paths:

  • JAVA_HOME ➝ Java SDK path
  • ANDROID_HOME ➝ Android SDK path
    Update the system PATH variable accordingly and restart your PC.

  1. Download the sample app (APK) and Selendroid standalone JAR.

Run Selendroid in terminal:

bash

java -jar selendroid-standalone.jar

  1.  The server starts on port 4444 by default.

Check device status:

bash

http://localhost:4444/wd/hub/status

Selendroid scans for connected Android devices and recognizes their configurations automatically.


ParameterDescription
-port [port#]Change default port (default: 4444)
-app [path]Set path to APK under test
-selendroidServerPort [port#]Change communication port (default: 8080)
-timeoutEmulatorStart [ms]Set timeout for emulator start (default: 300,000 ms)
-logLevel [level]Set log verbosity (ERROR, INFO, DEBUG, etc.)

Test Scenario:

  • Selendroid Tutorial for Beginners: Launch
  • Enter text
  • Press β€œShow Text” button
  • Verify output matches entered text

Setup Project in Eclipse:

  1. Create Java Project
  2. Add external JARs:
    • selendroid-client-0.10.0.jar
    • selendroid-standalone-0.11.0-with-dependencies.jar
    • selenium-java-2.40.0.jar
  3. Install TestNG plugin in Eclipse
  4. Create Java class .java in package com.guru.test

Get App ID and Element Locators:

Launch the Selendroid Inspector:

bash

http://localhost:4444/inspector

Use the inspector to get the following element IDs:

  • Button: btnShow
  • TextField: edtText
  • Label: txtView

βœ… Sample Code Snippet (Test Execution):

java

driver.findElement(By.id(“edtText”)).sendKeys

driver.findElement(By.id(“btnShow”)).click();

Thread.sleep(2000);

String actualText = driver.findElement(By.id(“txtView”)).getText();

Assert.assertEquals(actualText, “


  1. Connect your Android device (ensure no screen lock).
  2. Run the test from Eclipse ➝ Run As > TestNG Test.
  3. View TestNG report for results.

After execution, TestNG will automatically generate a detailed test report including passed/failed test cases and logs.

Robotium Tutorial

Official Appium Capability Doc

Leave a Comment

Index