> ## 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.

# click

> Click an element identified by description, CSS, or coordinates.

Primary mouse click. Provide exactly one of `on`, `css`, `coords`, or `x`/`y`.
The simplified form takes a single string description.

## Parameters

| Parameter         | Type                 | Required | Description                                                                                     |
| ----------------- | -------------------- | -------- | ----------------------------------------------------------------------------------------------- |
| `on`              | `string`             | No       | Natural-language description of the click target.                                               |
| `css`             | `string`             | No       | CSS selector for the target. Use instead of the description key.                                |
| `coords`          | `string \| { x, y }` | No       | Absolute viewport coordinates. Either an `x, y` string (e.g. `120, 40`) or a `{ x, y }` object. |
| `x`               | `number \| string`   | No       | X coordinate. Must be provided together with `y`.                                               |
| `y`               | `number \| string`   | No       | Y coordinate. Must be provided together with `x`.                                               |
| `force`           | `boolean`            | No       | Force the action even when the element is not actionable.                                       |
| `iframe`          | `string`             | No       | URL or URL pattern of the iframe that contains the target element.                              |
| `offset`          | `string \| { x, y }` | No       | Pixel offset from the resolved target. Either an `x, y` string or a `{ x, y }` object.          |
| `times`           | `number`             | No       | Number of times to click. Must be >= 1.                                                         |
| `waitForDownload` | `boolean`            | No       | Wait for a download to start after the click.                                                   |
| `delay`           | `number`             | No       | Milliseconds to hold between mousedown and mouseup.                                             |
| `downloadTimeout` | `number`             | No       | Maximum time in milliseconds to wait for a download.                                            |
| `saveAs`          | `string`             | No       | Name of the variable to write this step's return value to.                                      |
| `retries`         | `number`             | No       | Number of times to retry the step on failure before failing the test.                           |
| `skipped`         | `boolean`            | No       | Skip this step at execution time.                                                               |

## Shorthand

Target description as a single string.

```yaml theme={null}
- click: the GB regression test menu item
```

## Examples

```yaml theme={null}
- click:
    on: "the module card showing 'Module: testing-copilot'"
    waitForDownload: false
    retries: 2
```

```yaml theme={null}
- click:
    on: the button to download as zip
    waitForDownload: true
    saveAs: DOWNLOADED_FILE
```

```yaml theme={null}
- click:
    css: '[data-pendo-tracking="invoice-workspace-menu"]'
```

```yaml theme={null}
- click:
    on: the click here button
    iframe: https://bit.ly/3re1ic9
```

```yaml theme={null}
- click:
    coords: 0, 0
```

```yaml theme={null}
- click:
    on: the lucide save button in the top toolbar even if it is disabled
    force: true
```

## Related

* [Finding elements](/core-concepts/finding-elements)
* [Test format](/core-concepts/test-format)
