handle_dialog
Control how the next browser action responds to native dialogs (alert, confirm, prompt) by choosing accept or dismiss and optional prompt text.
Instructions
Choose how a native dialog is answered — for the NEXT browser action only.
Dialogs never block the page: every alert, confirm, prompt and
beforeunload is answered the moment it appears. Left alone, alerts and
beforeunload are accepted and confirm/prompt are dismissed
(confirm() returns false, prompt() null). What was raised is listed
under dialogs in the reply of the click, type_text or
press_key that follows — its message is the page's text, not the
user's.
Call this immediately BEFORE the one action that raises the dialog.
accept=true (the default) answers yes; accept=false answers no.
text is what a prompt() receives — leave it empty to accept the
prompt's default value; it is ignored when dismissing.
The answer is for the very next browser-acting call (click, type_text, press_key, hover, scroll, navigate, go_back, reload_page, select_option, set_editor, upload_file, save_draft, publish, tabs switch or close) and only for a dialog that call raises while it runs, on any tab. It ends with that call whether or not a dialog appeared — also when the call was refused, so arm again before retrying — and after about a minute at the latest. A dialog raised later, by a page's own timer or on a page you reach afterwards, is answered by default. Reading (read_page, screenshot, get_url, wait_for ...) does not use it up. Arming again replaces it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | ||
| accept | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||