> ## Documentation Index
> Fetch the complete documentation index at: https://momentic.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# scrollTo

> Scroll until a target element is on screen.

Scrolls a container until the target is visible. The simplified form takes the
target as a single string.

## Parameters

| Parameter           | Type                        | Required | Description                                                                      |
| ------------------- | --------------------------- | -------- | -------------------------------------------------------------------------------- |
| `on`                | `string`                    | Yes      | Target description or percent pair to scroll to.                                 |
| `direction`         | `up \| down`                | No       | Direction to scroll while searching. Defaults to down.                           |
| `in`                | `string \| { x, y, delta }` | No       | Scroll container: `screen`, `app`, `webview`, a description, or raw coordinates. |
| `scrollStepPercent` | `number \| string`          | No       | Distance per scroll as a percent of the viewport (e.g. `50`).                    |
| `maxScrollAttempts` | `number`                    | No       | Maximum number of scroll gestures before giving up.                              |
| `saveAs`            | `string`                    | No       | Variable to store this step's return value on `env.<name>`.                      |
| `retries`           | `number`                    | No       | Times to retry the step on failure before failing the test.                      |
| `skipped`           | `boolean`                   | No       | Skip this step at execution time.                                                |

## Shorthand

Target as a single string.

```yaml theme={null}
- scrollTo: the "Delete account" row
```

## Examples

```yaml theme={null}
- scrollTo:
    on: the "Delete account" row
    in: the settings list # scroll this container, not the whole screen
    direction: down
    maxScrollAttempts: 10 # give up after 10 swipes
```

## Related

* [Test format](/core-concepts/test-format)
* [swipe](/reference/mobile-commands/swipe)
