Package io.karatelabs.driver.cdp
Class CdpDialog
java.lang.Object
io.karatelabs.driver.cdp.CdpDialog
- All Implemented Interfaces:
Dialog
CDP-based implementation of Dialog.
Represents a JavaScript dialog (alert, confirm, prompt, or beforeunload).
Dialog types:
"alert"- Simple message dialog with OK button"confirm"- Dialog with OK and Cancel buttons"prompt"- Dialog with text input, OK and Cancel buttons"beforeunload"- Dialog shown when leaving page
-
Method Summary
Modifier and TypeMethodDescriptionvoidaccept()Accept the dialog (click OK/Yes).voidAccept the dialog with input text (for prompt dialogs).voiddismiss()Dismiss the dialog (click Cancel/No).Get the default prompt value (for prompt dialogs).Get the dialog message.getType()Get the dialog type.booleanCheck if this dialog has been handled.toString()
-
Method Details
-
getMessage
Description copied from interface:DialogGet the dialog message.- Specified by:
getMessagein interfaceDialog- Returns:
- the message displayed in the dialog
-
getType
Description copied from interface:DialogGet the dialog type. -
getDefaultPrompt
Description copied from interface:DialogGet the default prompt value (for prompt dialogs).- Specified by:
getDefaultPromptin interfaceDialog- Returns:
- the default value for prompt dialogs, or null for other types
-
accept
public void accept()Description copied from interface:DialogAccept the dialog (click OK/Yes). For prompt dialogs, this accepts with an empty string. -
accept
Description copied from interface:DialogAccept the dialog with input text (for prompt dialogs). -
dismiss
public void dismiss()Description copied from interface:DialogDismiss the dialog (click Cancel/No). -
isHandled
public boolean isHandled()Description copied from interface:DialogCheck if this dialog has been handled. -
toString
-