本文整理汇总了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;
}
}
示例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);
}
示例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;
}
示例4: refresh
import org.openqa.selenium.browserlaunchers.Sleeper; //导入依赖的package包/类
/**
* Allows TODO
*/
public void refresh() {
driver.navigate().refresh();
Sleeper.sleepTightInSeconds(2);
waitLoadingPage();
}
示例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);
}
示例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);
}