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

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

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

WebClient.setIncorrectnessListener介绍

[英]Returns the current HTML incorrectness listener.
[中]返回当前HTML不正确侦听器。

代码示例

代码示例来源:origin: searls/jasmine-maven-plugin

@Override
 protected WebClient modifyWebClient(WebClient client) {
  client.setAjaxController(new NicelyResynchronizingAjaxController());

  //Disables stuff like this "com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'text/javascript'."
  if (!this.debug) {
   client.setIncorrectnessListener((message, origin) -> {});
  }
  return client;
 }
}

代码示例来源:origin: com.github.searls/jasmine-maven-plugin

@Override
 protected WebClient modifyWebClient(WebClient client) {
  client.setAjaxController(new NicelyResynchronizingAjaxController());

  //Disables stuff like this "com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Obsolete content type encountered: 'text/javascript'."
  if (!this.debug) {
   client.setIncorrectnessListener(new IncorrectnessListener() {
    @Override
    public void notify(String message, Object origin) {
    }
   });
  }
  return client;
 }
}

代码示例来源:origin: com.github.seykron/htmlunit-maven-plugin

theClient.setIncorrectnessListener(new IncorrectnessListener() {
 @Override
 public void notify(final String message, final Object origin) {

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

webClient.setIncorrectnessListener(new IncorrectnessListener() {

代码示例来源:origin: com.synaptix.redpepper/redpepper-automation

@Override
  protected WebClient modifyWebClient(WebClient client) {
    myClient = client;
    client.getCookieManager().setCookiesEnabled(true);
    client.getOptions().setJavaScriptEnabled(true);
    client.getOptions().setCssEnabled(true);
    client.getOptions().setPopupBlockerEnabled(false);
    client.setIncorrectnessListener(new SilentIncorrectnessListener());
    client.setCssErrorHandler(new QuietCssErrorHandler());
    client.setAjaxController(new NicelyResynchronizingAjaxController());
    return client;
  }
}

代码示例来源:origin: timurstrekalov/saga

public static WebClient newInstance(final BrowserVersion version) {
  final WebClient client = new WebClient(version) {
    @Override
    public WebResponse loadWebResponse(final WebRequest webRequest) throws IOException {
      return new WebResponseProxy(super.loadWebResponse(webRequest));
    }
  };
  client.setIncorrectnessListener(quietIncorrectnessListener);
  client.setJavaScriptErrorListener(loggingJsErrorListener);
  client.setHTMLParserListener(quietHtmlParserListener);
  client.setCssErrorHandler(quietCssErrorHandler);
  client.getOptions().setJavaScriptEnabled(true);
  client.setAjaxController(new NicelyResynchronizingAjaxController());
  client.getOptions().setThrowExceptionOnScriptError(false);
  client.getOptions().setThrowExceptionOnFailingStatusCode(false);
  client.getOptions().setPrintContentOnFailingStatusCode(false);
  client.setWebConnection(new HttpWebConnection(client) {
    @Override
    protected WebResponse newWebResponseInstance(
        final WebResponseData responseData, final long loadTime, final WebRequest request) {
      return new WebResponseProxy(super.newWebResponseInstance(responseData, loadTime, request));
    }
  });
  return client;
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

WebClient webClient = new WebClient(browser);
webClient.setAlertHandler(this);
webClient.setIncorrectnessListener(this);
webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);

代码示例来源:origin: net.wetheinter/gwt-user

WebClient webClient = new WebClient(browser);
webClient.setAlertHandler(this);
webClient.setIncorrectnessListener(this);
webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);

相关文章

WebClient类方法