> For the complete documentation index, see [llms.txt](https://docs.drizz.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.drizz.dev/writing-tests/tap.md).

# Actions

`Tap` presses one element on screen. The description identifies the element; Vision AI locates it.

|                   |                                                                   |
| ----------------- | ----------------------------------------------------------------- |
| **Platforms**     | Android · iOS                                                     |
| **Targets by**    | Visible text, icon, position, neighboring element, section, color |
| **Best target**   | The element's exact visible label                                 |
| **Also accepted** | `Tap`, `Tap on`, `Tap the` — all the same command                 |
| **Watch out**     | Paraphrasing the label is the most common cause of a wrong tap    |

## Prerequisites

* A connected device or emulator
* An open test file
* The target screen reachable by the steps above the tap

## Copy this

```
OPEN_APP com.shopease.android
Wait Until 5 Seconds

Tap on the search icon
Type running shoes in the search field
Tap on the first search result
Wait Until 3 Seconds

Validate that the product detail page is visible
Tap on Add to Cart
Wait Until 2 Seconds
Validate that Item added to cart is visible
```

## Write a tap step

1. Read the element's exact visible label off the screen.
2. Write `Tap on <label>` using that wording, character for character.
3. Add one qualifier — position, neighbor, section, or color — when the label appears more than once on the screen.
4. Add `Wait Until <n> Seconds` after the tap when it triggers navigation or a network call.
5. Add a `Validate` on the next line when the tap navigates, submits or pays.
6. Run the test and confirm the report shows the tap resolving to the intended element.

## Targeting strategies

Drizz selects one element out of everything on screen. The description must be satisfied by exactly one element. The six strategies, in order of reliability:

| Strategy                        | Use when                                       | Example                                                         |
| ------------------------------- | ---------------------------------------------- | --------------------------------------------------------------- |
| **Exact visible label**         | The element has text                           | `Tap on Login CTA`                                              |
| **Icon by common name**         | The element has no text                        | `Tap the cart icon`                                             |
| **Position in a list**          | The same label repeats down the screen         | `Tap on the first Add beside product name`                      |
| **Relative to a neighbor**      | Each row has its own copy of the label         | `Tap Remove beside Product Details`                             |
| **Within a section**            | The same label appears in two sections         | `Tap Add under Snacks header`                                   |
| **Visual attribute or ranking** | State or a comparison is what distinguishes it | `Tap the green Active button` · `Tap the highest-rated product` |

## Examples

**Exact text — the default:**

```
Tap on Login CTA
Tap on Continue Button
Tap on Continue to Payment
```

**Icons, by the name people use for them:**

```
Tap the cart icon
Tap the profile icon
Tap the hamburger icon
Tap the settings icon
Tap the close icon
Tap the back arrow
Tap the search icon
```

**Position, when the label repeats:**

```
Tap on the first Add beside product name
Tap on the last Remove CTA
Tap the cart icon at top right
Tap Buy on the first card
```

**Section and neighbor context:**

```
Tap Add under Snacks header
Tap Remove beside Product Details
Tap Select next to Basic Plan option
Tap on % option under Discount
```

**Color and state, when nothing else separates them:**

```
Tap the green Active button
Tap the red Retry indicator
Tap the highlighted Selected tab
Tap the orange Offer badge
```

**Ranking and comparison — Drizz selects by value, not only by text:**

```
Tap the highest-rated product
Tap the lowest-priced item
Tap the plan with the maximum discount
Tap the restaurant with the most reviews
Tap the item with rating above 4.5
```

## Use the app's exact wording

If the button reads `Charge Now`, write `Charge Now` — not "Proceed to Pay", not "the payment button". Paraphrasing is the most common cause of a tap resolving to the wrong element, and it fails intermittently rather than immediately.

## Validate after a tap

A tap that navigates, submits or pays is followed by a `Validate`. Without one, a mis-resolved tap surfaces several steps later, on an unrelated screen.

```
Tap on Place Order
Wait Until 3 Seconds
Validate that Order Placed is visible
```

## When a tap won't resolve

Add context first — a neighbor, a section header, a position. [`MAP_ACTION`](/writing-tests/tap/map-action.md) targets elements that have no label and no clean bounding box.

{% hint style="success" %}
A tap that keeps failing immediately after a `Type`  might be a keyboard problem — see [Type](/writing-tests/tap/type.md).
{% endhint %}

## Common mistakes

<table data-search="false"><thead><tr><th>What you wrote</th><th>What happens</th></tr></thead><tbody><tr><td><code>Tap on the payment button</code> when the button reads <code>Charge Now</code></td><td>Vision AI guesses. It resolves to a different control, or fails on some runs and not others</td></tr><tr><td><code>Tap on Add</code> on a screen with five <code>Add</code> buttons</td><td>One of them is tapped, and which one can change between runs</td></tr><tr><td><code>Tap on the third product</code> when list order is server-driven</td><td>Passes on your device, fails on the next run with different data. Target by label instead</td></tr><tr><td><code>Tap on the blue button in the middle of the screen near the bottom</code></td><td>Long positional prose is weaker than the label. Use the label, add one qualifier</td></tr><tr><td><code>MAP_ACTION Tap on Continue</code> when <code>Continue</code> has a visible label</td><td>A deterministic tap traded for a grid guess</td></tr><tr><td>A tap immediately after <code>Type</code>, with no wait</td><td>The keyboard or a transition can still cover the target and the step reports as undoable</td></tr></tbody></table>

## Next

* [Type](/writing-tests/tap/type.md) — entering text, and keyboard handling
* [Validate](/writing-tests/tap/validate.md) — asserting the result of a tap
* [MAP\_ACTION](/writing-tests/tap/map-action.md) — unlabeled elements and gestures

***

*Last updated: 6 August 2026*
