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


Java Sleeper类代码示例

本文整理汇总了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;
    }
}
 
开发者ID:viltgroup,项目名称:minium,代码行数:17,代码来源:AsyncTimeElapsedInteraction.java

示例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();
	}
}
 
开发者ID:redskyit,项目名称:ScriptDriver,代码行数:8,代码来源:RunTests.java

示例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();
	}
}
 
开发者ID:redskyit,项目名称:ScriptDriver,代码行数:8,代码来源:RunTests.java

示例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);
    }
}
 
开发者ID:jhc-systems,项目名称:redsniff,代码行数:8,代码来源:Waiter.java

示例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);
}
 
开发者ID:MagenTys,项目名称:cinnamon,代码行数:8,代码来源:SearchContextWait.java

示例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);
}
 
开发者ID:lesfurets,项目名称:selenium-lxc,代码行数:11,代码来源:SeleniumWait.java

示例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);
   }
}
 
开发者ID:gwtd3,项目名称:gwt-d3,代码行数:9,代码来源:DemoApplication.java

示例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 ");
}
  }
 
开发者ID:gwtd3,项目名称:gwt-d3,代码行数:9,代码来源:DemoApplication.java

示例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));
}
 
开发者ID:RUB-NDS,项目名称:PrOfESSOS,代码行数:4,代码来源:BrowserSimulator.java

示例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);
}
 
开发者ID:codezombies,项目名称:easytest,代码行数:4,代码来源:WebDriverWait2.java

示例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);
}
 
开发者ID:relateiq,项目名称:AugmentedDriver,代码行数:7,代码来源:WebElementWait.java

示例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;
}
 
开发者ID:Nordstrom,项目名称:Selenium-Foundation,代码行数:26,代码来源:SearchContextWait.java

示例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);
}
 
开发者ID:qmetry,项目名称:qaf,代码行数:20,代码来源:QAFWebDriverWait.java

示例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);
}
 
开发者ID:qmetry,项目名称:qaf,代码行数:21,代码来源:QAFWebElementWait.java


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