Dialogs

JavaScript dialogs block the page until someone answers. The agent should report dialog_open, list the dialog and let you accept or dismiss it.

DLG-01Alert from a click

Click Show alert, then answer it with page_dialog.

ExpectThe click returns dialog_open; page_dialogs lists type alert with message Range alert; after accepting, DLG-01 closed.

DLG-02Confirm

Accept or dismiss the question.

ExpectDLG-02 answer=true after accept, DLG-02 answer=false after dismiss.

DLG-03Prompt

Accept with prompt_text, or dismiss. The default answer is guest.

ExpectDLG-03 answer=<your text>; dismissing gives answer=null.

DLG-04Dialog from a timer

The click itself returns normally; the alert opens 1.5 seconds later. A command sent while it is open should report dialog_open.

ExpectClick: ok. A later command: dialog_open. Unanswered, the agent dismisses it after 60 seconds and the log shows DLG-04 closed.

DLG-05Leave-page warning

Arm the warning, then reload or navigate away. Chrome only shows it after the page has had a real user interaction.

ExpectA beforeunload dialog may appear; page_dialogs lists it with type beforeunload.