Sets up webDriver to be used.
@param aWebDriver web driver to use.
@param defaultTimeout default timeout to wait, in seconds.
5721
public void setWebDriver(WebDriver aWebDriver, int defaultTimeout) {
        if (webDriver != null && !webDriver.equals(aWebDriver)) {
            webDriver.quit();
        }
        webDriver = aWebDriver;

        if (webDriver == null) {
            webDriverWait = null;
        } else {
            webDriverWait = new WebDriverWait(webDriver, defaultTimeout);
        }
    }
1203799
public SwimMembershipProtocolConfig setFailureTimeout(Duration failureTimeout) {
    checkNotNull(failureTimeout, "failureTimeout cannot be null");
    checkArgument(!failureTimeout.isNegative() && !failureTimeout.isZero(), "failureTimeout must be positive");
    this.failureTimeout = checkNotNull(failureTimeout);
    return this;
  }
1264509
public ServerBuilder idleTimeout(Duration idleTimeout) {
        requireNonNull(idleTimeout, "idleTimeout");
        idleTimeoutMillis = ServerConfig.validateIdleTimeoutMillis(idleTimeout.toMillis());
        return this;
    }
876918
@Override
	public void waitForElementPresent() throws WidgetException {
		try {
			waitForElementPresent(getGUIDriver().getMaxRequestTimeout());
		} catch (Exception e) {
			throw new WidgetException("Error while waiting for element to be present", locator, e);
		}
	}
1038192
static void initSelectTimeout() {
        String currentTimeout = System.getProperty(PROPERTY_NETTY_SELECT_TIMEOUT);
        if (currentTimeout == null || "".equals(currentTimeout)) {
            try {
                System.setProperty(PROPERTY_NETTY_SELECT_TIMEOUT, Long.toString(DEFAULT_SELECT_TIMEOUT_MILLIS));
            }
            catch (SecurityException e) {
                if (logger.isWarnEnabled()) {
                    logger.warn(String.format(
                            "Unable to set System property \"%s\" to %d due to %s, Gateway performance may be reduced",
                            PROPERTY_NETTY_SELECT_TIMEOUT, DEFAULT_SELECT_TIMEOUT_MILLIS, e));
                }
            }
        }
    }
67695
public void setTimeout(String value) {

        try {
            setTimeout(Long.parseLong(value));
        } catch (Exception e) {
            LOG.error(
                Messages.get().getBundle().key(Messages.LOG_PARSE_TIMEOUT_FAILED_2, value, new Long(DEFAULT_TIMEOUT)),
                e);
            setTimeout(DEFAULT_TIMEOUT);
        }
    }
943068
def wait(self, condition):
        
        return WebDriverWait(self.driver, self.timeout).until(condition)
314455
public void startDriverOnUrl(final WebDriver webDriver, final String browserUrl) {
        setCommandProcessor(startWebDriverCommandProcessor(browserUrl, webDriver));
        setTimeoutOnSelenium();
        LOG.debug("Started command processor");
    }
771762
@Value("${http.timeout}")
    @SuppressWarnings("static-method")
    public void setDefaultHttpTimeout(int httpTimeout) {
        HttpUtil.defaultHttpTimeout = httpTimeout;
        HttpUtil.httpTimeout = httpTimeout;
    }
1332948
public void waitForElementToBeVisible(final By by, final int maximumSeconds) {
		WebDriverWait wait = new WebDriverWait(driver, maximumSeconds);
		wait.until(ExpectedConditions.visibilityOfElementLocated(by));
	}
625093
public CliCommandBuilder setTimeout(final int timeout) {
        if (timeout > 0) {
            addCliArgument(CliArgument.TIMEOUT, Integer.toString(timeout));
        } else {
            addCliArgument(CliArgument.TIMEOUT, null);
        }
        return this;
    }
861314
public void setDefaultTimeout(long timeout, TimeUnit unit) {
        this.timeout = timeout;
        this.unit    = unit;
        bootstrap.setOption("connectTimeoutMillis", unit.toMillis(timeout));
    }
832420
public void setConnectTimeout(int timeout) {
		Assert.isTrue(timeout >= 0, "Timeout must be a non-negative value");
		this.connectTimeout = timeout;
		setLegacyConnectionTimeout(getHttpClient(), timeout);
	}
1360463
public JmxServerBuilder timeout(long timeout) {
        endpoint.setDefaultTimeout(timeout);
        endpoint.getEndpointConfiguration().setTimeout(timeout);
        return this;
    }
103500
@Override
	public void go() {
		logger.info("Waiting {} seconds for {}...", timeout, element);
		WebDriverWait waiting = new WebDriverWait(getWebDriver(), timeout);
		try {
			waiting.until(ExpectedConditions.presenceOfElementLocated(element));
		} catch (NullPointerException e) {
			fail(String.format("Element %s did not appear within %d seconds.", element, timeout), e);
		}
	}
1073970
public WebDriverWait newWebDriverWait() {
		return wef.getSleepMillis() > 0L
			? newWebDriverWait(wef.getTimeoutSeconds(), wef.getSleepMillis())
				: newWebDriverWait(wef.getTimeoutSeconds());
	}
140207
public void waitForElementNotPresent(final long time) throws WidgetException {
		try {
			waitForCommand(new ITimerCallback() {

				@Override
				public boolean execute() throws WidgetException {
					return !isElementPresent();
				}

				@Override
				public String toString() {
					return "Waiting for element with locator " + locator + " to not be present";
				}
			}, time);
		} catch (Exception e) {
			throw new WidgetException("Error while waiting for element to be not present", locator, e);
		}
	}