handleJavaScriptDialog

suspend fun handleJavaScriptDialog(args: Page.HandleJavaScriptDialogParameter, mode: CommandMode = CommandMode.DEFAULT)

Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).


suspend fun handleJavaScriptDialog(accept: Boolean, promptText: String? = null)

Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload).

Parameters

accept

Whether to accept or dismiss the dialog.

promptText

The text to enter into the dialog prompt before accepting. Used only if this is a prompt dialog.