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

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

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

WebClient.getAlertHandler介绍

[英]Returns the alert handler for this webclient.
[中]返回此webclient的警报处理程序。

代码示例

代码示例来源:origin: org.jvnet.hudson/htmlunit

/**
 * The JavaScript function "alert()".
 * @param message the message
 */
public void jsxFunction_alert(final Object message) {
  // use Object as parameter and perform String conversion by ourself
  // this allows to place breakpoint here and "see" the message object and its properties
  final String stringMessage = Context.toString(message);
  final AlertHandler handler = getWebWindow().getWebClient().getAlertHandler();
  if (handler == null) {
    LOG.warn("window.alert(\"" + stringMessage + "\") no alert handler installed");
  }
  else {
    handler.handleAlert(document_.getHtmlPage(), stringMessage);
  }
}

代码示例来源:origin: org.jenkins-ci/htmlunit

/**
 * The JavaScript function "alert()".
 * @param message the message
 */
public void jsxFunction_alert(final Object message) {
  // use Object as parameter and perform String conversion by ourself
  // this allows to place breakpoint here and "see" the message object and its properties
  final String stringMessage = Context.toString(message);
  final AlertHandler handler = getWebWindow().getWebClient().getAlertHandler();
  if (handler == null) {
    LOG.warn("window.alert(\"" + stringMessage + "\") no alert handler installed");
  }
  else {
    handler.handleAlert(document_.getHtmlPage(), stringMessage);
  }
}

代码示例来源:origin: net.disy.htmlunit/htmlunit

/**
 * The JavaScript function "alert()".
 * @param message the message
 */
public void jsxFunction_alert(final Object message) {
  // use Object as parameter and perform String conversion by ourself
  // this allows to place breakpoint here and "see" the message object and its properties
  final String stringMessage = Context.toString(message);
  final AlertHandler handler = getWebWindow().getWebClient().getAlertHandler();
  if (handler == null) {
    LOG.warn("window.alert(\"" + stringMessage + "\") no alert handler installed");
  }
  else {
    handler.handleAlert(document_.getHtmlPage(), stringMessage);
  }
}

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

/**
 * The JavaScript function {@code alert()}.
 * @param message the message
 */
@JsxFunction
public void alert(final Object message) {
  // use Object as parameter and perform String conversion by ourself
  // this allows to place breakpoint here and "see" the message object and its properties
  final String stringMessage = Context.toString(message);
  final AlertHandler handler = getWebWindow().getWebClient().getAlertHandler();
  if (handler == null) {
    LOG.warn("window.alert(\"" + stringMessage + "\") no alert handler installed");
  }
  else {
    handler.handleAlert(document_.getPage(), stringMessage);
  }
}

代码示例来源:origin: HtmlUnit/htmlunit

/**
 * The JavaScript function {@code alert()}.
 * @param message the message
 */
@JsxFunction
public void alert(final Object message) {
  // use Object as parameter and perform String conversion by ourself
  // this allows to place breakpoint here and "see" the message object and its properties
  final String stringMessage = Context.toString(message);
  final AlertHandler handler = getWebWindow().getWebClient().getAlertHandler();
  if (handler == null) {
    LOG.warn("window.alert(\"" + stringMessage + "\") no alert handler installed");
  }
  else {
    handler.handleAlert(document_.getPage(), stringMessage);
  }
}

相关文章

WebClient类方法