本文整理了Java中com.gargoylesoftware.htmlunit.WebClient.setPromptHandler()
方法的一些代码示例,展示了WebClient.setPromptHandler()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebClient.setPromptHandler()
方法的具体详情如下:
包路径:com.gargoylesoftware.htmlunit.WebClient
类名称:WebClient
方法名:setPromptHandler
[英]Sets the handler that will be executed when the JavaScript method Window.prompt() is called.
[中]设置JavaScript方法窗口打开时将执行的处理程序。调用prompt()。
代码示例来源:origin: com.axway.ats.framework/ats-uiengine
@Override
@PublicAtsApi
public void clickCancel() {
isProcessed = false;
webClient.setPromptHandler(new PromptHandler() {
@Override
public String handlePrompt(
Page currentPage,
String promptText,
String defaultValue ) {
isProcessed = true;
return null;
}
});
}
代码示例来源:origin: com.axway.ats.framework/ats-uiengine
@Override
@PublicAtsApi
public void clickOk(
final String promptValue ) {
isProcessed = false;
webClient.setPromptHandler(new PromptHandler() {
@Override
public String handlePrompt(
Page currentPage,
String promptText,
String defaultValue ) {
isProcessed = true;
return promptValue;
}
});
}
代码示例来源:origin: com.axway.ats.framework/ats-uiengine
@Override
@PublicAtsApi
public void clickOk(
final String expectedText,
final String promptValue ) {
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 promptValue;
}
});
}
代码示例来源:origin: com.axway.ats.framework/ats-uiengine
@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;
}
});
}
代码示例来源:origin: net.sourceforge.jwebunit/jwebunit-htmlunit-plugin
wc.setPromptHandler(new PromptHandler() {
@Override
public String handlePrompt(Page page, String msg) {
内容来源于网络,如有侵权,请联系作者删除!