AlertActions
Static methodsâ
onAlert
â
This will return IAlertActions
which will expose different methods to handle Alerts.
IAlertActions alertActions = AlertActions.onAlert ();
Instance methodsâ
accept (text)
â
This method will enter the text in the prompt, accept the Alert and will return the Alert message.
import static io.github.boykaframework.actions.drivers.AlertActions.onAlert;
. . .
String message = onAlert ().accept ("some text");
accept
â
This method will accept the Alert and return the Alert message.
import static io.github.boykaframework.actions.drivers.AlertActions.onAlert;
. . .
String message = onAlert ().accept ();
dismiss
â
This method will dismiss the Alert and return the Alert message.
import static io.github.boykaframework.actions.drivers.AlertActions.onAlert;
. . .
String message = onAlert ().dismiss ();
verifyAccept
â
This method is used to verify the alert message after accepting the alert.
import static io.github.boykaframework.actions.drivers.AlertActions.onAlert;
. . .
onAlert ().verifyAccept ().isEqualTo ("Swag Labs");
verifyAccept (text)
â
This method is used to verify the alert message after entering the text in the prompt and accepting it.
import static io.github.boykaframework.actions.drivers.AlertActions.onAlert;
. . .
onAlert ().verifyAccept ("Sample text").isEqualTo ("Swag Labs");
verifyDismiss
â
This method is used to verify the alert message after dismissing the alert.
import static io.github.boykaframework.actions.drivers.AlertActions.onAlert;
. . .
onAlert ().verifyDismiss ().isEqualTo ("Swag Labs");