本文整理了Java中org.openqa.selenium.remote.RemoteWebDriver.getWindowHandles
方法的一些代码示例,展示了RemoteWebDriver.getWindowHandles
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RemoteWebDriver.getWindowHandles
方法的具体详情如下:
包路径:org.openqa.selenium.remote.RemoteWebDriver
类名称:RemoteWebDriver
方法名:getWindowHandles
暂无
代码示例来源:origin: la-team/light-admin
@Override
public Set<String> getWindowHandles() {
return webDriver.getWindowHandles();
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-test-ui
@Override
public Set<String> getWindowHandles()
{
return this.wrappedDriver.getWindowHandles();
}
代码示例来源:origin: org.eclipse.che.selenium/che-selenium-core
@Override
public Set<String> getWindowHandles() {
return driver.getWindowHandles();
}
代码示例来源:origin: com.applitools/eyes-selenium-java3
public Set<String> getWindowHandles() {
return driver.getWindowHandles();
}
代码示例来源:origin: org.mycore/selenium-utils
public Set<String> getWindowHandles() {
return delegate.getWindowHandles();
}
代码示例来源:origin: stackoverflow.com
public static void moveToAnotherTab(RemoteWebDriver driver) {
for (String winHandle : driver.getWindowHandles()) {
driver.switchTo().window(winHandle);
}
}
代码示例来源:origin: com.github.becauseQA/becauseQA-utils
public WebDriver window(String windowHandleOrName) {
try {
execute(DriverCommand.SWITCH_TO_WINDOW, ImmutableMap.of("handle", windowHandleOrName));
return RemoteWebDriver.this;
} catch (NoSuchWindowException nsw) {
// simulate search by name
String original = getWindowHandle();
for (String handle : getWindowHandles()) {
switchTo().window(handle);
if (windowHandleOrName.equals(executeScript("return window.name"))) {
return RemoteWebDriver.this; // found by name
}
}
switchTo().window(original);
throw nsw;
}
}
代码示例来源:origin: com.github.becausetesting/commons
/**
* @Title: switchToWindowWithTitle @Description: TODO @author
* ahu@greendotcorp.com @param @param windowTitle @return void
* return type @throws
*/
public void switchToWindowWithTitle(String windowTitle) {
// throw new PendingException();
try {
Robot robot = new Robot();
Set<String> allwindows = driver.getWindowHandles();
for (String window : allwindows) {
driver.switchTo().window(window);
if (driver.getTitle().contains(windowTitle)) {
robot.delay(5000);
// robot.keyPress(keycode);
}
}
} catch (AWTException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
内容来源于网络,如有侵权,请联系作者删除!