use of com.gargoylesoftware.htmlunit.Page in project ats-framework by Axway.
the class HiddenHtmlPrompt method clickCancel.
@Override
@PublicAtsApi
public void clickCancel(final String expectedText) {
isProcessed = false;
webClient.setPromptHandler(new PromptHandler() {
@Override
public String handlePrompt(Page currentPage, String promptText, String defaultValue) {
isProcessed = true;
if (!promptText.equals(expectedText)) {
throw new VerificationException("The expected prompt text was: '" + expectedText + "', but actually it is: '" + promptText + "'");
}
return null;
}
});
}
use of com.gargoylesoftware.htmlunit.Page in project ats-framework by Axway.
the class HiddenHtmlConfirm method clickOk.
@Override
@PublicAtsApi
public void clickOk() {
isProcessed = false;
webClient.setConfirmHandler(new ConfirmHandler() {
@Override
public boolean handleConfirm(Page currentPage, String confirmationText) {
isProcessed = true;
return true;
}
});
}
use of com.gargoylesoftware.htmlunit.Page in project ats-framework by Axway.
the class HiddenHtmlConfirm method clickCancel.
@Override
@PublicAtsApi
public void clickCancel(final String expectedConfirmText) {
isProcessed = false;
webClient.setConfirmHandler(new ConfirmHandler() {
@Override
public boolean handleConfirm(Page currentPage, String confirmationText) {
isProcessed = true;
if (!confirmationText.equals(expectedConfirmText)) {
throw new VerificationException("The expected confirm message was: '" + expectedConfirmText + "', but actually it is: '" + confirmationText + "'");
}
return false;
}
});
}
use of com.gargoylesoftware.htmlunit.Page 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.Page 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