本文整理汇总了Java中org.openqa.selenium.support.ui.Sleeper类的典型用法代码示例。如果您正苦于以下问题:Java Sleeper类的具体用法?Java Sleeper怎么用?Java Sleeper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Sleeper类属于org.openqa.selenium.support.ui包,在下文中一共展示了Sleeper类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: waitUntilCompleted
import org.openqa.selenium.support.ui.Sleeper; //导入依赖的package包/类
@Override
public void waitUntilCompleted() {
try {
long end = MILLISECONDS.convert(duration.getTime(), duration.getUnit());
long time = (start + end) - System.currentTimeMillis();
if (time > 0) {
Sleeper.SYSTEM_SLEEPER.sleep(new org.openqa.selenium.support.ui.Duration(time, MILLISECONDS));
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
} finally {
start = -1;
}
}
示例2: sleepSeconds
import org.openqa.selenium.support.ui.Sleeper; //导入依赖的package包/类
private void sleepSeconds(long seconds) {
try {
Sleeper.SYSTEM_SLEEPER.sleep(new Duration(seconds, java.util.concurrent.TimeUnit.SECONDS));
} catch (InterruptedException e) {
e.printStackTrace();
}
}
示例3: sleep
import org.openqa.selenium.support.ui.Sleeper; //导入依赖的package包/类
private void sleep(long ms) {
try {
Sleeper.SYSTEM_SLEEPER.sleep(new Duration(ms, java.util.concurrent.TimeUnit.MILLISECONDS));
} catch (InterruptedException e) {
e.printStackTrace();
}
}
示例4: sleep
import org.openqa.selenium.support.ui.Sleeper; //导入依赖的package包/类
public void sleep(Duration duration) {
try {
Sleeper.SYSTEM_SLEEPER.sleep(duration);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
示例5: SearchContextWait
import org.openqa.selenium.support.ui.Sleeper; //导入依赖的package包/类
protected SearchContextWait(final SearchContext input, final Clock clock, final Sleeper sleeper, final long timeout,
final TimeUnit timeoutTimeUnit, final long sleep, final TimeUnit sleepTimeUnit) {
super(input, clock, sleeper);
withTimeout(timeout, timeoutTimeUnit);
pollingEvery(sleep, sleepTimeUnit);
ignoring(NotFoundException.class);
}
示例6: SeleniumWait
import org.openqa.selenium.support.ui.Sleeper; //导入依赖的package包/类
public SeleniumWait(WebDriver input) {
super(input, new SystemClock(), new Sleeper() {
@Override
public void sleep(Duration duration) {
}
});
ignoring(NoSuchElementException.class, StaleElementReferenceException.class);
pollingEvery(100, TimeUnit.MILLISECONDS);
}
示例7: DemoApplication
import org.openqa.selenium.support.ui.Sleeper; //导入依赖的package包/类
private DemoApplication(final WebDriver driver) {
super(driver);
try {
Sleeper.SYSTEM_SLEEPER.sleep(new Duration(5, TimeUnit.SECONDS));
} catch (InterruptedException e) {
throw new RuntimeException("cannot wait", e);
}
}
示例8: revealDemoDragMultiple
import org.openqa.selenium.support.ui.Sleeper; //导入依赖的package包/类
public DemoDragMultiple revealDemoDragMultiple() {
try {
Sleeper.SYSTEM_SLEEPER.sleep(new Duration(5, TimeUnit.SECONDS));
return new DemoDragMultiple(driver, this).reveal();
} catch (InterruptedException e) {
throw new RuntimeException("do the thing ");
}
}
示例9: waitMillis
import org.openqa.selenium.support.ui.Sleeper; //导入依赖的package包/类
protected void waitMillis(long timeout) throws InterruptedException {
Sleeper.SYSTEM_SLEEPER.sleep(new Duration(timeout, TimeUnit.MILLISECONDS));
}
示例10: WebDriverWait2
import org.openqa.selenium.support.ui.Sleeper; //导入依赖的package包/类
public WebDriverWait2(final WebDriver driver, final long timeOutInSeconds, final long sleepInMillis) {
super(driver, new SystemClock(), Sleeper.SYSTEM_SLEEPER, timeOutInSeconds, sleepInMillis);
}
示例11: WebElementWait
import org.openqa.selenium.support.ui.Sleeper; //导入依赖的package包/类
public WebElementWait(SearchContext element, long timeoutInSeconds) {
super(element, new SystemClock(), Sleeper.SYSTEM_SLEEPER);
withTimeout(timeoutInSeconds, TimeUnit.SECONDS);
pollingEvery(500, TimeUnit.MILLISECONDS);
ignoring(WebDriverException.class);
}
示例12: SearchContextWait
import org.openqa.selenium.support.ui.Sleeper; //导入依赖的package包/类
/**
* Wait will ignore instances of NotFoundException that are encountered
* (thrown) by default in the 'until' condition, and immediately propagate
* all others. You can add more to the ignore list by calling
* ignoring(exceptions to add).
*
* @param context
* The SearchContext instance to pass to the expected conditions
* @param clock
* The clock to use when measuring the timeout
* @param sleeper
* Object used to make the current thread go to sleep.
* @param timeOutInSeconds
* The timeout in seconds when an expectation is
* @param sleepTimeOut
* The timeout used whilst sleeping. Defaults to 500ms called.
*/
public SearchContextWait(SearchContext context, Clock clock, Sleeper sleeper, long timeOutInSeconds,
long sleepTimeOut) {
super(context, clock, sleeper);
withTimeout(timeOutInSeconds, TimeUnit.SECONDS);
pollingEvery(sleepTimeOut, TimeUnit.MILLISECONDS);
ignoring(NotFoundException.class);
this.context = context;
}
示例13: QAFWebDriverWait
import org.openqa.selenium.support.ui.Sleeper; //导入依赖的package包/类
/**
* @param driver
* The WebDriver instance to pass to the expected conditions
* @param clock
* The clock to use when measuring the timeout
* @param sleeper
* Object used to make the current thread go to sleep.
* @param timeOutInSeconds
* The timeout in seconds when an expectation is
* @param sleepTimeOut
* The timeout used whilst sleeping. Defaults to 500ms called.
*/
protected QAFWebDriverWait(QAFExtendedWebDriver driver, Clock clock, Sleeper sleeper,
long timeOutInMiliSeconds, long sleepTimeOut) {
super(driver, clock, sleeper);
withTimeout(timeOutInMiliSeconds, TimeUnit.MILLISECONDS);
pollingEvery(sleepTimeOut, TimeUnit.MILLISECONDS);
ignoring(StaleElementReferenceException.class);
}
示例14: QAFWebElementWait
import org.openqa.selenium.support.ui.Sleeper; //导入依赖的package包/类
/**
* @param element
* The WebElement instance to pass to the expected conditions
* @param clock
* The clock to use when measuring the timeout
* @param sleeper
* Object used to make the current thread go to sleep.
* @param timeOutInSeconds
* The timeout in seconds when an expectation is
* @param sleepTimeOut
* The timeout used whilst sleeping. Defaults to 500ms called.
*/
@SuppressWarnings("unchecked")
protected QAFWebElementWait(QAFExtendedWebElement element, Clock clock, Sleeper sleeper, long timeOutInMiliSeconds,
long sleepTimeOut) {
super(element, clock, sleeper);
withTimeout(timeOutInMiliSeconds, TimeUnit.MILLISECONDS);
pollingEvery(sleepTimeOut, TimeUnit.MILLISECONDS);
ignore(NoSuchElementException.class, StaleElementReferenceException.class);
}