- Docs
- Reference
- Step reference
- Mobile actions
Mobile actions
Mobile projects (Android and iOS) have their own action types, run through Appium on a local device, an emulator or a Device Farm device. This page lists them all, with the value each one needs.
In short
On this page you can
- Tap, swipe, scroll, pinch and drag on Android and iOS screens.
- Type, clear and press device keys such as Enter or Back.
- Launch, close, reset, install or background the app under test.
- Read text or attributes into variables and assert on them.
- Add ready-made steps without a locator from Global.
How to use it
- Capture the screen’s elements with the Appium Inspector, or pick saved actions with Action.
- Add locator-free steps (Hide Keyboard, Scroll Down, Press Back…) with Global.
- Fill each step’s value in the right panel: text, direction, key or variable name.
- Insert values from earlier Get Text steps with the step variable picker.
- Save and run a Dry Run on a local device or a Device Farm device.
How mobile steps are created#
- Appium Inspector. In a mobile test case the record slot opens the inspector on a live device. Tap an element, choose the action type, and use Add Test Step; Save Steps adds them to the test case (“Don't forget to save.”). See Discover › Mobile.
- Action. Pick saved mobile actions from the Action List.
- Global. Ready-made steps that need no element. See Global actions.
The step types below exist only in MOBILE projects (Android and iOS). Shared step types (Assertion, Python, API, Database, Mail, Kafka, Global parameter, Wait (seconds), AI) work here too.
Touch and gestures#
| Action | Chip | Does | Locator | Value |
|---|---|---|---|---|
| Tap | Tap | Taps an element (single touch). | Yes | — |
| Double Tap | DblTap | Double-taps an element. | Yes | — |
| Long Press | LongPress | Presses and holds an element. | Yes | — |
| Swipe | Swipe | Swipes in a direction. | No | Direction: up, down, left, right |
| Scroll | Scroll | Scrolls the screen (a swipe the other way). Without anything to scroll, nothing happens and the step does not fail. | No | Direction: up, down, left, right |
| Tap First List Item | TapFirst | Taps an item of the vertical list on screen, found without a locator. Tab bars and banners are ignored. | No | Index: 0 = first, 1 = second… |
| Pinch | Pinch | Pinch gesture to zoom in or out. | Yes | Scale: below 1 zooms out, above 1 zooms in (default 0.5) |
| Drag & Drop | Drag | Drags an element and drops it on a target. | Yes | The drop target, set in the step |
Input and keys#
| Action | Chip | Does | Value |
|---|---|---|---|
| Type Text | Type | Types text into a mobile input field. | The text |
| Clear | Clear | Clears all text from an input field. | — |
| Clear & Type | ClrType | Clears the field, then types new text. | The text |
| Hide Keyboard | HideKbd | Dismisses the on-screen keyboard. Use it when the keyboard covers a button. | — |
| Press Key | PressKey | Presses a device or keyboard key. | An Android keycode (66) or a key name (ENTER) |
Key names for Press Key (case does not matter): HOME, BACK, VOLUME_UP, VOLUME_DOWN, POWER, MENU, TAB, SPACE, ENTER, RETURN, DEL, DELETE, BACKSPACE, SEARCH, ESCAPE, ESC, FORWARD_DEL, NUMPAD_ENTER. On iOS there are no keycodes: Home and volume go to the hardware buttons, Back navigates back, and Enter, Tab, Space and Delete are typed into the focused field. Log: Device key was pressed (keycode 66).
App lifecycle#
| Action | Chip | Does | Value |
|---|---|---|---|
| Launch App | Launch | Launches the application from scratch. The app of the project’s mobile settings is used. | — |
| Close App | Close | Closes the application. | — |
| Reset App | Reset | Resets the app state: clears data and restarts. | — |
| Background App | Bg | Sends the app to the background for N seconds, then brings it back. | Seconds |
| Activate App | Activate | Brings the app back to the foreground. | — |
| Install App | Install | Installs an APK or IPA on the device. | The app file |
| Remove App | Remove | Uninstalls an app from the device. | The app |
Navigation#
| Action | Chip | Does | Value |
|---|---|---|---|
| Press Back | Back | Presses the device Back button (on iOS: back navigation). | — |
| Press Home | Home | Presses the device Home button; the app goes to the background. | — |
| Switch Context | Ctx | Switches between the native and the webview context of a hybrid app. | The context |
| Open Notifications | Notif | Opens the notifications panel. | — |
| Open Deep Link | DeepLink | Opens a deep link URL inside the app. | The URL, for example myapp://orders/1042 |
Read values#
| Action | Chip | Does | Output |
|---|---|---|---|
| Get Text | GetTxt | Captures an element’s text and stores it as a variable. | The variable you name |
| Get Attribute | GetAttr | Captures an element attribute (for example content-desc) and stores it. | The variable you name |
| Store Variable | Store | Stores a fixed value as a variable for later steps. | The variable you name |
In later steps, the value field offers Insert step variable: a list of the Get Text, Get Attribute and Store Variable steps above (“Step variables (this test case)”). If two earlier steps set the same name, the tooltip warns that the last value wins at run time. These steps also accept the per-step Timeout (1–300 seconds).
Waits and assertions#
| Action | Chip | Passes when | Value |
|---|---|---|---|
| Wait For Element | Wait | The element appears. | — |
| Wait For Text | WaitTxt | The expected text appears in the element. | The text |
| Wait For Visible | WaitVis | The element becomes visible. | — |
| Assert Visible | AssertVis | The element is visible. | — |
| Assert Not Visible | AssertNotVis | The element is not visible. | — |
| Assert Text | AssertTxt | The element’s text matches the expected value. | The expected text |
A failed assertion logs, for example, The text of "Total" did not match the expected value "€ 12.00" (found: "€ 10.00") and stops the test case. A wait that runs out logs "Login" did not appear in time.
Global actions#
Global on the step toolbar (tooltip “Global Actions (Pre-built Mobile Steps)”) opens Global Actions: pre-built mobile steps you add without capturing an element. They are the same in every mobile project. Search with “Search action…” and click Add to step list. In the step list they show an orange chip with a bolt icon.
| Global action | Type and value | Use it to |
|---|---|---|
| Hide Keyboard | Hide Keyboard | Close the keyboard when it covers a button. |
| Scroll Down / Up / Left / Right | Scroll, direction | Reveal content or move a carousel. |
| Tap List Item | Tap First List Item, index 0 | Tap a list item without a locator; change the index in the step. |
| Swipe Down / Up | Swipe, direction | Pull to refresh, close a bottom sheet. |
| Press Back, Press Home | Press Back, Press Home | Go back, or send the app to the background. |
| Open Notifications | Open Notifications | Test push notifications. |
| Press Enter | Press Key, keycode 66 | Submit a form from the keyboard. |
| Launch App, Close App, Reset App | App lifecycle | Start clean or end a test. |
| Background App 5s | Background App, 5 seconds | Test session refresh after the app was in the background. |
At run time#
- Where. A Dry Run runs on a local device or emulator through your agent and Appium (
http://localhost:4723), or on a Device Farm device. A pipeline picks its own devices on its Mobile Settings tab (the agent’s Connected Device, or SmartTest Device Farm devices); only AWS Device Farm and BrowserStack use the device list of the project’s Mobile Config. See Connect mobile and desktop. - Time. Each step has a budget of the project’s Wait Timeout + 10 seconds; an AI step gets 35 seconds more.
- Healing. Mobile steps are not auto-healed. Keep locators stable (accessibility id, resource-id).
- Ambiguous locators. When a locator matches several elements, the first one is tapped. The inspector warns about this when you capture.
If something goes wrong#
Didn’t find your answer?Write to support with your project name and what you see on screen.
info@smartestqa.ai