use of com.gargoylesoftware.htmlunit.AlertHandler in project ats-framework by Axway.
the class HiddenHtmlAlert method clickOk.
@Override
@PublicAtsApi
public void clickOk(final String expectedAlertText) {
isProcessed = false;
webClient.setAlertHandler(new AlertHandler() {
@Override
public void handleAlert(Page alertPage, String alertText) {
isProcessed = true;
if (!alertText.equals(expectedAlertText)) {
throw new VerificationException("The expected alert message was: '" + expectedAlertText + "', but actually it is: '" + alertText + "'");
}
}
});
}
use of com.gargoylesoftware.htmlunit.AlertHandler in project ats-framework by Axway.
the class HiddenHtmlAlert method clickOk.
@Override
@PublicAtsApi
public void clickOk() {
isProcessed = false;
webClient.setAlertHandler(new AlertHandler() {
@Override
public void handleAlert(Page alertPage, String alertText) {
isProcessed = true;
// do nothing, by default it clicks the OK button
}
});
}
Aggregations