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

# dialog

> Auto-handle the next browser dialog (alert/confirm/prompt).

Registers an action for the next native dialog the page raises. Schedule the
`dialog` step before the step that triggers the dialog (e.g. a `click` that
calls `window.confirm`).

## Parameters

| Parameter | Type                    | Required | Description                                                           |
| --------- | ----------------------- | -------- | --------------------------------------------------------------------- |
| `action`  | `"ACCEPT" \| "DISMISS"` | Yes      | Whether to accept or dismiss the next dialog.                         |
| `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

`ACCEPT` or `DISMISS`.

```yaml theme={null}
- dialog: ACCEPT
```

## Examples

```yaml theme={null}
- dialog:
    action: ACCEPT
```

```yaml theme={null}
- dialog:
    action: DISMISS
```

## Related

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