You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class Alerts {
private SHAFT.GUI.WebDriver driver;
public Alerts(SHAFT.GUI.WebDriver driver) {
this.driver = driver;
}
public void Handling_Alerts() {
// we need to use AlertActions class ⬇⬇
AlertActions alert = driver.element().performAlertAction();
// if you want to accept alert ⬇⬇
alert.acceptAlert();
// if you want to dismiss alert ⬇⬇
alert.dismissAlert();
// if you want to get a text of an alert ⬇⬇
alert.getAlertText();
// if you want to send text into the alert ⬇⬇
alert.typeIntoPromptAlert("your text");
// if you want to check if the alert is present ⬇⬇
alert.isAlertPresent();
}
}
The text was updated successfully, but these errors were encountered:
This how to handle alerts using SHAFT.
package pages;
import com.shaft.driver.SHAFT;
import com.shaft.gui.element.AlertActions;
public class Alerts {
private SHAFT.GUI.WebDriver driver;
}
The text was updated successfully, but these errors were encountered: