• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Clock类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MediaCodecRenderer类代码示例发布时间:2022-05-23
下一篇:
Java FileConfigurationOptions类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap