当前位置: 首页>>代码示例>>Java>>正文


Java Sleeper类代码示例

本文整理汇总了Java中org.openqa.selenium.browserlaunchers.Sleeper的典型用法代码示例。如果您正苦于以下问题:Java Sleeper类的具体用法?Java Sleeper怎么用?Java Sleeper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Sleeper类属于org.openqa.selenium.browserlaunchers包,在下文中一共展示了Sleeper类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: switchToNewWindow

import org.openqa.selenium.browserlaunchers.Sleeper; //导入依赖的package包/类
/**
 * switch focus of WebDriver to the next found window handle (that's your
 * newly opened window)
 */
public void switchToNewWindow() {
    handledWindowList.add(driver.getWindowHandle());
    Sleeper.sleepTightInSeconds(3);
    for (final String winHandle : driver.getWindowHandles())
        if (!handledWindowList.contains(winHandle)) {
            driver.switchTo().window(winHandle);
            break;
        }
}
 
开发者ID:awltech,项目名称:easycukes,代码行数:14,代码来源:Page.java

示例2: waitLoadingPage

import org.openqa.selenium.browserlaunchers.Sleeper; //导入依赖的package包/类
/**
 * @return
 */
public void waitLoadingPage() {
    if (loadProgressBy != null)
        waitUntilElementIsHidden(loadProgressBy);
    if (waitNotificationToHide && notifyBy != null)
        waitUntilElementIsHidden(notifyBy);
    Sleeper.sleepTightInSeconds(1);
}
 
开发者ID:awltech,项目名称:easycukes,代码行数:11,代码来源:Page.java

示例3: updateStatus

import org.openqa.selenium.browserlaunchers.Sleeper; //导入依赖的package包/类
@Override
public UpdateStatusPanel updateStatus(String status) {
    Preconditions.checkNotNull(status, "Status parameter is null");
    updateStatusTextArea.clear();
    updateStatusTextArea.sendKeys(status);
    postButton.click();
    int wait = 0;
    while (wait++ <= WAIT_FOR_POST_UPDATE && postButton.isDisplayed()) {
        Sleeper.sleepTightInSeconds(5);
    }
    return this;
}
 
开发者ID:lalit-k,项目名称:selenium-java-tests,代码行数:13,代码来源:UpdateStatusPanelImpl.java

示例4: refresh

import org.openqa.selenium.browserlaunchers.Sleeper; //导入依赖的package包/类
/**
 * Allows TODO
 */
public void refresh() {
    driver.navigate().refresh();
    Sleeper.sleepTightInSeconds(2);
    waitLoadingPage();
}
 
开发者ID:awltech,项目名称:easycukes,代码行数:9,代码来源:Page.java

示例5: for

import org.openqa.selenium.browserlaunchers.Sleeper; //导入依赖的package包/类
/**
 * Waits for a certain time
 *
 * @param seconds amount of time to wait in seconds
 * @throws Throwable
 */
@When("^wait for (\\d+) seconds$")
public void waitForSomeSeconds(int seconds) throws Throwable {
    log.info("waiting " + seconds + " seconds");
    Sleeper.sleepTightInSeconds(seconds);
}
 
开发者ID:awltech,项目名称:easycukes,代码行数:12,代码来源:SeleniumCommonStepdefs.java

示例6: before

import org.openqa.selenium.browserlaunchers.Sleeper; //导入依赖的package包/类
/**
 * Defines the sleeping time to apply for a scenario
 *
 * @param scenario
 */
@Before
public void before(Scenario scenario) {
    Sleeper.sleepTightInSeconds(1);
}
 
开发者ID:awltech,项目名称:easycukes,代码行数:10,代码来源:SeleniumConfigurationStepdefs.java


注:本文中的org.openqa.selenium.browserlaunchers.Sleeper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。