com.gargoylesoftware.htmlunit.WebClient.setRefreshHandler()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(173)

本文整理了Java中com.gargoylesoftware.htmlunit.WebClient.setRefreshHandler()方法的一些代码示例,展示了WebClient.setRefreshHandler()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebClient.setRefreshHandler()方法的具体详情如下:
包路径:com.gargoylesoftware.htmlunit.WebClient
类名称:WebClient
方法名:setRefreshHandler

WebClient.setRefreshHandler介绍

[英]Sets the handler to be used whenever a refresh is triggered. Refer to the documentation for RefreshHandler for more details.
[中]设置每当触发刷新时要使用的处理程序。有关更多详细信息,请参阅RefreshHandler的文档。

代码示例

代码示例来源:origin: net.sourceforge.jwebunit/jwebunit-htmlunit-plugin

public void setRefreshHandler(RefreshHandler handler) {
 this.refreshHandler = handler;
 if (wc != null) {
  wc.setRefreshHandler(refreshHandler);
 }
}

代码示例来源:origin: stackoverflow.com

public class HtmlUnitDriverExt extends HtmlUnitDriver { 
 public HtmlUnitDriverExt(BrowserVersion version) {
  super(version);
 }
 @Override
 protected WebClient modifyWebClient(WebClient client) {
  client.setRefreshHandler(new RefreshHandler());
  return client;
 }
}

代码示例来源:origin: stackoverflow.com

@Override
protected WebClient modifyWebClient(WebClient client) {
  RefreshHandler rh = new RefreshHandler() {
    public void handleRefresh(final Page page, final URL url, final int seconds) { }
  };
  client.setRefreshHandler(rh);
  return client;
}

代码示例来源:origin: com.atlassian.integrationtesting/atlassian-integrationtesting-lib

CompositeUiTester(ApplicationProperties applicationProperties,
    Function<Login, HtmlPage> login, 
    Function<WebSudoLogin, HtmlPage> webSudoLogin, 
    Function<UiTester, Void> logout,
    Function<UiTester, String> getLoggedInUser,
    Function<UiTester, Boolean> isOnLogInPage,
    Function<Backup, Void> restore)
{
  this.applicationProperties = applicationProperties;
  this.webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_11);
  webClient.getOptions().setThrowExceptionOnScriptError(false);
  webClient.setRefreshHandler(new WaitingRefreshHandler());
  webClient.setAlertHandler(new AlertHandler()
  {
    public void handleAlert(Page page, String message)
    {
      System.out.println("ALERT: " + message);
    }
  });
  
  this.login = login;
  this.webSudoLogin = webSudoLogin;
  this.logout = logout;
  this.getLoggedInUser = getLoggedInUser;
  this.isOnLogInPage = isOnLogInPage;
  this.restore = restore;
}

代码示例来源:origin: com.axway.ats.framework/ats-uiengine

webClient.setRefreshHandler(new RefreshHandler() {

代码示例来源:origin: org.seleniumhq.selenium/selenium-htmlunit-driver

private WebClient createWebClient(BrowserVersion version) {
 WebClient client = newWebClient(version);
 WebClientOptions options = client.getOptions();
 options.setHomePage(WebClient.URL_ABOUT_BLANK.toString());
 options.setThrowExceptionOnFailingStatusCode(false);
 options.setPrintContentOnFailingStatusCode(false);
 options.setJavaScriptEnabled(enableJavascript);
 options.setRedirectEnabled(true);
 options.setUseInsecureSSL(true);
 // Ensure that we've set the proxy if necessary
 if (proxyConfig != null) {
  options.setProxyConfig(proxyConfig);
 }
 client.setRefreshHandler(new WaitingRefreshHandler());
 return modifyWebClient(client);
}

代码示例来源:origin: net.sourceforge.jwebunit/jwebunit-htmlunit-plugin

wc.getOptions().setUseInsecureSSL(true);
if (refreshHandler == null) {
 wc.setRefreshHandler(new ImmediateRefreshHandler());
} else {
 wc.setRefreshHandler(refreshHandler);

相关文章

WebClient类方法