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.

@FunctionalInterface public interface DialogHandler
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

    Modifier and Type
    Method
    Description
    void
    handle(Dialog dialog)
    Handle a JavaScript dialog.