# tapOn

Taps on an element using a [selector](https://docs.moropo.com/creating-tests/test-step-selectors).

## Options

Tap on text

```yaml
- tapOn:
    text: "some text"
```

Tap on an element with ID

```yaml
- tapOn:
    id: "some-id"
```

Tap on a point in the top left corner of the screen

```yaml
- tapOn:
    point: 10%,10%
```

Tap on a point in the center of the screen

```yaml
- tapOn:
    point: 50%,50%
```

### Repeating Taps

If you need to tap multiple times, make use of the `repeat` option:

```yaml
- tapOn:
    id: "some-id"
    repeat: 4
```

By default, taps will occur 100 milliseconds apart; you can change this using the `delay` option:

```yaml
- tapOn:
    id: "some-id"
    repeat: 2
    delay: 300
```

*Note: for a double tap, you may prefer the* [*doubleTa*](https://docs.moropo.com/creating-tests/commands/tapon)[*pOn*](https://docs.moropo.com/creating-tests/commands/tapon) *command*

### Retry Tap If No Change

If the test runner does not detect a view change after an `tapOn` command, then it will automatically tap again.&#x20;

On Android, this sometimes manifests as a double tap which can cause issues in your test steps.

You can disable this behaviour by setting the `retryTapIfNoChange` option to `false`:

<pre class="language-yaml"><code class="lang-yaml"><strong>- tapOn:
</strong>    id: "submit-button"
    retryTapIfNoChange: false
</code></pre>

### Wait to Settle Timeout

By default, the runner will dynamically wait for any animations to finish before executing a command. This ensures that the screen is stable, and any content is loaded, before proceeding. The argument `waitToSettleTimeoutMs` will force override the wait after a configured number of milliseconds.&#x20;

However, in some cases, this might be undesirable behaviour such as with animation-heavy apps.&#x20;

<pre class="language-yaml"><code class="lang-yaml"><strong>- tapOn:
</strong>    id: "submit-button"
    waitToSettleTimeoutMs: 500 # waits 500ms for screen to be settle before executing
</code></pre>

## Related Commands

[longpress](https://docs.moropo.com/creating-tests/commands/longpress "mention")

[tapon](https://docs.moropo.com/creating-tests/commands/tapon "mention")
