Introduction to Android App Automation Testing Frameworks and Appium Setup Guide

This article introduces common Android app automation testing frameworks such as Instrumentation, UIAutomator, Robotium, Monkey, MonkeyRunner, MonkeyTalk, and Appium, explains their features and limitations, and provides detailed installation and usage instructions for Appium with Python examples.

360 Quality & Efficiency
360 Quality & Efficiency
360 Quality & Efficiency
Introduction to Android App Automation Testing Frameworks and Appium Setup Guide

APP automation testing frameworks are introduced, covering the most common Android solutions.

1. Instrumentation – an early Google tool that runs test code in the same process as the app, simulating key events but cannot cross app boundaries and requires extensive configuration.

2. UIAutomator – runs test code in a separate process, supports most Android events, works across apps, but lacks WebView support and toast text extraction, requiring Android SDK level 16 or higher.

3. Robotium – built on Instrumentation, offers simple APIs for activities, dialogs, toasts, menus, and other UI components, yet still cannot cross app boundaries.

4. Monkey – a command‑line tool that generates random UI events for stress testing, useful for stability checks.

5. MonkeyRunner – provides an API to control devices and emulators from outside the Android code, suitable for functional and unit testing.

6. MonkeyTalk – an open‑source, cross‑platform recorder/player supporting iOS and Android, enabling readable test scripts and HTML5 feature testing, but requires source code access.

7. Appium – a popular, cross‑platform framework supporting iOS, Android, and FirefoxOS, using WebDriver‑compatible scripts; it relies on UIAutomator for Android SDK ≥16 and Selendroid for lower versions.

When selecting a framework, consider openness, extensibility, script simplicity, maintenance cost, Android client support, result verification, and CI integration. Reference link: https://my.oschina.net/androidtest/blog/372278?fromerr=TMxfHrfn

Appium Framework Overview

Appium follows a client‑server architecture where the client (test code written in Java, Python, Ruby, etc.) sends REST commands to the Appium server (Node.js). The server executes commands on the device and returns results via HTTP.

Session – a session starts after a POST request with Desired Capabilities, returning a Session ID used for all subsequent commands.

Desired Capabilities – a key‑value map describing the test environment (platform, app package, etc.).

Installation Steps

1. Install JDK and set environment variables:

JAVA_HOME=D:\Java\jdk1.7.0_45
CLASSPATH=.;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar
PATH=%JAVA_HOME%\bin;%PATH%

2. Install Node.js and verify version: node -v 3. Install Android SDK (ADT) and set ANDROID_HOME and PATH accordingly.

4. Install Appium globally: npm install -g appium (or use Chinese registry: npm --registry http://registry.cnpmjs.org install -g appium)

5. Verify Appium installation: appium (should display "socket.io started")

6. Run appium-doctor to ensure all dependencies are satisfied.

7. Set up Python environment:

pip install selenium -i http://pypi.douban.com/simple
pip install --upgrade setuptools
pip install Appium-Python-Client

After completing the setup, launch an Android emulator, start the Appium server, and run test scripts.

Appium Automation Process Example

The article demonstrates a Python‑based test targeting a mobile browser. Steps include installing the browser APK, configuring Desired Capabilities, writing browser_test.py, starting Appium, executing the script, and reviewing results in myAppiumLog.html.

Reference link: http://www.yangyanxing.com/article/1266.html

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AndroidframeworksAppiumautomation testing
360 Quality & Efficiency
Written by

360 Quality & Efficiency

360 Quality & Efficiency focuses on seamlessly integrating quality and efficiency in R&D, sharing 360’s internal best practices with industry peers to foster collaboration among Chinese enterprises and drive greater efficiency value.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.