本文整理了Java中com.gargoylesoftware.htmlunit.WebWindowEvent.getNewPage()
方法的一些代码示例,展示了WebWindowEvent.getNewPage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebWindowEvent.getNewPage()
方法的具体详情如下:
包路径:com.gargoylesoftware.htmlunit.WebWindowEvent
类名称:WebWindowEvent
方法名:getNewPage
[英]Returns the oldPage.
[中]返回旧页。
代码示例来源:origin: stackoverflow.com
webClient.addWebWindowListener( new WebWindowListener() {
void webWindowContentChanged(WebWindowEvent event) {
System.out.println("2nd Page : "+event.getNewPage().asText());
webClient.closeAllWindows();
}
...
});
button.click();
webClient.waitForBackgroundJavaScript(TIMEOUT);
代码示例来源:origin: net.sourceforge.htmlunit/htmlunit
builder.append(getOldPage());
builder.append("] newPage=[");
builder.append(getNewPage());
builder.append("])");
代码示例来源:origin: net.sourceforge.jwebunit/jwebunit-htmlunit-plugin
@Override
public void webWindowOpened(WebWindowEvent event) {
String win = event.getWebWindow().getName();
Page newPage = event.getNewPage();
if (newPage instanceof HtmlPage) {
logger.debug("Window {} opened : {}", win, ((HtmlPage) newPage).getTitleText());
} else {
logger.info("Window {} opened", win);
}
}
});
代码示例来源:origin: HtmlUnit/htmlunit
builder.append(getOldPage());
builder.append("] newPage=[");
builder.append(getNewPage());
builder.append("])");
代码示例来源:origin: org.jenkins-ci/htmlunit
buffer.append(getOldPage());
buffer.append("] newPage=[");
buffer.append(getNewPage());
buffer.append("])");
代码示例来源:origin: org.jvnet.hudson/htmlunit
buffer.append(getOldPage());
buffer.append("] newPage=[");
buffer.append(getNewPage());
buffer.append("])");
代码示例来源:origin: net.disy.htmlunit/htmlunit
buffer.append(getOldPage());
buffer.append("] newPage=[");
buffer.append(getNewPage());
buffer.append("])");
代码示例来源:origin: org.openqa.selenium.webdriver/webdriver-htmlunit
public void webWindowContentChanged(WebWindowEvent webWindowEvent) {
WebWindow window = webWindowEvent.getWebWindow();
if (waitingToLoad) {
waitingToLoad = false;
webClient.setCurrentWindow(window);
}
History history = histories.get(window);
if (history == null) {
history = new History(window);
histories.put(window, history);
}
history.addNewPage(webWindowEvent.getNewPage());
}
代码示例来源:origin: org.jvnet.hudson/htmlunit
/**
* Returns true if the two objects are equal.
*
* @param object the object to compare against
* @return true if the two objects are equal
*/
@Override
public boolean equals(final Object object) {
if (getClass() == object.getClass()) {
final WebWindowEvent event = (WebWindowEvent) object;
return isEqual(getSource(), event.getSource())
&& getEventType() == event.getEventType()
&& isEqual(getOldPage(), event.getOldPage())
&& isEqual(getNewPage(), event.getNewPage());
}
return false;
}
代码示例来源:origin: org.jenkins-ci/htmlunit
/**
* Returns true if the two objects are equal.
*
* @param object the object to compare against
* @return true if the two objects are equal
*/
@Override
public boolean equals(final Object object) {
if (getClass() == object.getClass()) {
final WebWindowEvent event = (WebWindowEvent) object;
return isEqual(getSource(), event.getSource())
&& getEventType() == event.getEventType()
&& isEqual(getOldPage(), event.getOldPage())
&& isEqual(getNewPage(), event.getNewPage());
}
return false;
}
代码示例来源:origin: net.disy.htmlunit/htmlunit
/**
* Returns true if the two objects are equal.
*
* @param object the object to compare against
* @return true if the two objects are equal
*/
@Override
public boolean equals(final Object object) {
if (getClass() == object.getClass()) {
final WebWindowEvent event = (WebWindowEvent) object;
return isEqual(getSource(), event.getSource())
&& getEventType() == event.getEventType()
&& isEqual(getOldPage(), event.getOldPage())
&& isEqual(getNewPage(), event.getNewPage());
}
return false;
}
代码示例来源:origin: net.sourceforge.jwebunit/jwebunit-htmlunit-plugin
@Override
public void webWindowContentChanged(WebWindowEvent event) {
form = null;
String winName = event.getWebWindow().getName();
Page oldPage = event.getOldPage();
Page newPage = event.getNewPage();
String oldPageTitle = "no_html";
if (oldPage instanceof HtmlPage) {
oldPageTitle = ((HtmlPage) oldPage).getTitleText();
}
String newPageTitle = "no_html";
if (newPage instanceof HtmlPage) {
newPageTitle = ((HtmlPage) newPage).getTitleText();
}
logger.debug("Window \"{}\" changed : \"{}\" became \"{}", new Object[] {winName, oldPageTitle, newPageTitle});
}
代码示例来源:origin: net.sourceforge.htmlunit/htmlunit
/**
* Returns true if the two objects are equal.
*
* @param object the object to compare against
* @return true if the two objects are equal
*/
@Override
public boolean equals(final Object object) {
if (null == object) {
return false;
}
if (getClass() == object.getClass()) {
final WebWindowEvent event = (WebWindowEvent) object;
return isEqual(getSource(), event.getSource())
&& getEventType() == event.getEventType()
&& isEqual(getOldPage(), event.getOldPage())
&& isEqual(getNewPage(), event.getNewPage());
}
return false;
}
代码示例来源:origin: HtmlUnit/htmlunit
/**
* Returns true if the two objects are equal.
*
* @param object the object to compare against
* @return true if the two objects are equal
*/
@Override
public boolean equals(final Object object) {
if (null == object) {
return false;
}
if (getClass() == object.getClass()) {
final WebWindowEvent event = (WebWindowEvent) object;
return isEqual(getSource(), event.getSource())
&& getEventType() == event.getEventType()
&& isEqual(getOldPage(), event.getOldPage())
&& isEqual(getNewPage(), event.getNewPage());
}
return false;
}
内容来源于网络,如有侵权,请联系作者删除!