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");