> For the complete documentation index, see [llms.txt](https://docs.testfirst.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.testfirst.com/testfirst-editor/android-mobile-automation/write-a-mobile-test.md).

# Write a Mobile Test

Reference both the application and mobile device in your test.

{% hint style="info" %}
Every mobile test must specify an application endpoint and a mobile device endpoint before launching the application.
{% endhint %}

#### Launch the Application

```gherkin
Scenario: Start emulator and run the app
  Given application "{Android apps.TestFirst Sample 1}"
  Given mobile device "{Devices.Android.Pixel 10}"
  When I run application
```

The application and mobile device values are resolved from the Data Repository.

#### Interact with Mobile Elements and Validate Content

```gherkin
Scenario: Test 1
  When I tap "Show table"
  And I tap "R2C2"
  And I tap "R6C3"
  Then "R6C3 - clicked" is displayed in mobile device
```

#### Scroll and Navigate

```gherkin
Scenario: Test 2
  When I scroll down in mobile device
  And I wait for 2 seconds
  And I tap "Back"
```

### Supported Mobile Actions

Mobile tests support common Android interactions including:

* Launching applications
* Tapping elements
* Scrolling
* Waiting
* Validating displayed content
* Device navigation actions

Additional mobile actions may be available depending on the target application and device.
