本文整理汇总了Java中org.openqa.selenium.support.ui.Clock类的典型用法代码示例。如果您正苦于以下问题:Java Clock类的具体用法?Java Clock怎么用?Java Clock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Clock类属于org.openqa.selenium.support.ui包,在下文中一共展示了Clock类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: apply
import org.openqa.selenium.support.ui.Clock; //导入依赖的package包/类
@Override
public Statement apply(Statement statement) throws Throwable {
return () -> {
Clock clock = new SystemClock();
long end = clock.laterBy(timeout.in(TimeUnit.MILLISECONDS));
Throwable lastException;
do {
try {
return statement.evaluate();
} catch (Throwable e) {
lastException = e;
if (ignoring.stream().anyMatch(clazz -> clazz.isInstance(e))) {
try {
Thread.sleep(polling.in(TimeUnit.MILLISECONDS));
} catch (InterruptedException i) {
break;
}
} else {
Throwables.propagate(e);
}
}
} while ((clock.isNowBefore(end)));
throw lastException;
};
}
开发者ID:eroshenkoam,项目名称:htmlelements,代码行数:26,代码来源:RetryStatement.java
示例2: SearchContextWait
import org.openqa.selenium.support.ui.Clock; //导入依赖的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);
}
开发者ID:MagenTys,项目名称:cinnamon,代码行数:8,代码来源:SearchContextWait.java
示例3: SearchContextWait
import org.openqa.selenium.support.ui.Clock; //导入依赖的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;
}
开发者ID:Nordstrom,项目名称:Selenium-Foundation,代码行数:26,代码来源:SearchContextWait.java
示例4: QAFWebDriverWait
import org.openqa.selenium.support.ui.Clock; //导入依赖的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);
}
开发者ID:qmetry,项目名称:qaf,代码行数:20,代码来源:QAFWebDriverWait.java
示例5: QAFWebElementWait
import org.openqa.selenium.support.ui.Clock; //导入依赖的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);
}
开发者ID:qmetry,项目名称:qaf,代码行数:21,代码来源:QAFWebElementWait.java
注:本文中的org.openqa.selenium.support.ui.Clock类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论