For the complete documentation index, see llms.txt. This page is also available as Markdown.

Android Mobile Automation

Android Mobile Automation allows you to automate Android applications using the TestFirst Editor. Tests can be written using the same Gherkin syntax used for web automation, making it easy to create, maintain, and execute mobile test scenarios alongside your existing automated tests.

Mobile automation supports running applications on Android emulators or existing Android devices and interacting with mobile UI elements using actions such as tapping, scrolling, waiting, and validations.

asterisk

Prerequisites

Before running Android mobile tests, configure the Android tools on the machine where tests will execute.

1

Install Java

Install Amazon Corretto 25.

2

Install Android Command-Line Tools

  1. Download the Android Command-Line Tools from:

    https://developer.android.com/studio#command-tools

  2. Extract the files so the following directory exists:

C:\Tools\Android\cmdline-tools\latest
  1. Create the following environment variable:

ANDROID_SDK_ROOT=C:\Tools\Android
3

Install Android Emulator Image

Run:

sdkmanager "system-images;android-36.1;google_apis;x86_64"

⚠️ This must be installed using the Android Command-Line Tools. Installing the image through Android Studio is not sufficient.

4

Install Android Platform Tools

  1. Extract the package so the following directory exists:

C:\Tools\Android\platform-tools
5

Install Android Build Tools

Navigate to:

C:\Tools\Android\cmdline-tools\latest\bin

Run:

sdkmanager "build-tools;36.1.0"

Configure the Application

Before writing a mobile test, add the Android application to the Data Repository.

  1. Open Data Repository

  2. Select Endpoints

  3. Create a new endpoint

  4. Set the endpoint type to App

  5. Upload the APK file

  6. Save the endpoint

The application can then be referenced from your test case.

Configure a Mobile Device

Mobile tests require a mobile device endpoint.

  1. Open Data Repository

  2. Select Endpoints

  3. Create a new endpoint

  4. Set the endpoint type to Mobile Device

  5. Enter the device configuration and save the endpoint

Start an Emulator

Use the following configuration when TestFirst should start an emulator automatically.

Use an Existing Device or Emulator

Use the following configuration when an Android emulator or device is already running.

Next Steps

After configuring your Android environment:

  1. Use Appium Inspector if you need to inspect application elements while creating selectors.

  2. Write your first mobile test.

  3. Run the test from the Editor.

Last updated