> For the complete documentation index, see [llms.txt](https://help.autify.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.autify.com/nocode-web/en/faq/faq-create-scenario/faq-recording/recording-alert-dialogs.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# Recording alert dialogs

## Overview

An alert dialog is a type of dialog that notifies the user about important information, such as when an error has occurred, or when input is required by the user to continue. Alert dialogs can be closed by clicking on an option — commonly `OK` or `Cancel`.

Using Autify Recorder, you can record actions taken on alert dialogs.

This document explains how the following types of alert dialog are handled by Autify Recorder:

* Alert
* Confirm
* Prompt
* Before a page is unloaded

This document also contains some information about how each type of alert dialog behaves during test execution.

## Alert

This is a simple alert dialog with only one option to click — `OK`.

<img src="https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-8f6861443ceeb30d0d308b35f43767698f5cf4c8%2Falert-dialog-en.png?alt=media" alt="" width="400">

### Options

`OK`

### Step Recorded by Autify

`Handle Alert`

### Test execution behavior

Autify will choose `OK`.

## Confirm

This is an alert dialog that presents the user with some information and two options to click.

<img src="https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-e92a6554aa116ee5aa942ab039cff3fa3ef080cf%2Fconfirm-dialog-en.png?alt=media" alt="" width="400">

### Options

* `OK`
* `Cancel`

### Step Recorded by Autify Recorder

`Handle Alert`

### Test execution behavior

Autify will always choose `OK`, even if `Cancel` is clicked during recording.

## Prompt

This is an alert dialog that accepts input from the user and two options to click.

<img src="https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-7eff07bc595cf66c3997a36255e4172aece97fb9%2Fprompt-dialog-en.png?alt=media" alt="" width="400">

### Options

* `OK`
* `Cancel`

### Step Recorded by Autify Recorder

`Input Text Into Alert`

### Test execution behavior

The given text will be input into the prompt during test execution. Autify will always choose `OK`, even if `Cancel` is clicked during recording.

## Before a page is unloaded

This is an alert that is triggered when a user is about to leave the page, for example, by closing the window. In this document, this type of alert will be referred to as a `beforeunload` alert.

<img src="https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-516694f33180df583de43d70f08e99abe82f66b9%2Funload-dialog-en.png?alt=media" alt="" height="200">

### Options

* `Leave`
* `Cancel`

### Step Recorded by Autify Recorder

Autify Recorder does not record any steps for `beforeunload` alerts.

### Test execution behavior <a href="#test-execution-behavior" id="test-execution-behavior"></a>

During test execution, all desktop browsers (Chrome, Edge, Firefox, and Safari) will automatically accept `beforeunload` alerts. This is native to the browsers — not a functionality of Autify.

{% hint style="warning" %}
Some, not all, real mobile devices might not accept `beforeunload` alerts automatically during test execution. In such cases, please add a `Handle Alert` step to your scenario to handle the alert by clicking the `+` button in the scenario editor screen. If you want to run your scenario on desktop browsers too, set the step to `Ignore and continue` on failure.

<img src="https://1964297753-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVdZPTgwISYb3LhjgKnw6%2Fuploads%2Fgit-blob-8a0e15cd02c5c930e6aa98e13916d01471bda374%2Fimage(211).png?alt=media" alt="" data-size="original">
{% endhint %}

## Related articles

For permission dialogs that request access to the camera, location, etc., please refer to the following article: [Can I allow location, microphone, and camera alert dialogs when recording?](https://help.autify.com/nocode-web/en/faq/faq-create-scenario/faq-recording/can-i-allow-location-microphone-and-camera-alert-dialogs.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.autify.com/nocode-web/en/faq/faq-create-scenario/faq-recording/recording-alert-dialogs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
