protected InternalSystemClock getClock() { return new InternalSystemClock(); }
/** * Pause execution for the requested delay. * Throws a runtime exception if something goes wrong. */ public void pauseFor(final long timeInMilliseconds) { try { sleepFor(timeInMilliseconds); } catch (InterruptedException e) { LOGGER.error("Wait interrupted:" + e.getMessage()); throw new RuntimeException("System timer interrupted", e); } }
public WebDriver toStartNewDriverWith(DesiredCapabilities desiredCapabilities) throws IOException { try { return getDriverServicePool().newDriver(desiredCapabilities); } catch (NoSuchSessionException e) { if (maxTries == 0) { throw e; } LOGGER.error(e.getClass().getCanonicalName() + " happened - retrying in 2 seconds"); new InternalSystemClock().pauseFor(2000); return new TryAtMost(maxTries - 1).toStartNewDriverWith(desiredCapabilities); } } }
/** * Type a value into a field and then press TAB, making sure that the field is empty first. * This currently is not supported by all browsers, notably Firefox. * * @param value */ @Override public WebElementFacade typeAndTab(final String value) { logIfVerbose("Type and tab '" + value + "'"); if (driverIsDisabled()) { return this;} waitUntilElementAvailable(); clear(); getElement().sendKeys(value); getElement().sendKeys(Keys.TAB); getClock().pauseFor(100); notifyScreenChange(); return this; }
/** * Type a value into a field and then press TAB, making sure that the field is empty first. * This currently is not supported by all browsers, notably Firefox. * * @param value */ @Override public WebElementFacade typeAndTab(final String value) { logIfVerbose("Type and tab '" + value + "'"); enableHighlightingIfRequired(); waitUntilElementAvailable(); clear(); getElement().sendKeys(value); getElement().sendKeys(Keys.TAB); getClock().pauseFor(100); notifyScreenChange(); return this; }
/** * Pause execution for the requested delay. * Throws a runtime exception if something goes wrong. */ public void pauseFor(final long timeInMilliseconds) { try { sleepFor(timeInMilliseconds); } catch (InterruptedException e) { LOGGER.error("Wait interrupted:" + e.getMessage()); throw new RuntimeException("System timer interrupted", e); } }
protected InternalSystemClock getClock() { return new InternalSystemClock(); }