Package io.karatelabs.driver
Interface DialogHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Functional interface for handling JavaScript dialogs (alert, confirm, prompt, beforeunload).
Usage:
driver.onDialog(dialog -> {
if (dialog.getType().equals("confirm")) {
dialog.accept();
} else if (dialog.getType().equals("prompt")) {
dialog.accept("user input");
} else {
dialog.dismiss();
}
});
-
Method Summary
-
Method Details
-
handle
Handle a JavaScript dialog. The handler must call eitherDialog.accept(),Dialog.accept(String), orDialog.dismiss()to resolve the dialog.- Parameters:
dialog- the dialog to handle
-