public static void setTimeoutImplicit(WebDriver webDriver, String timeout) { WebDriver.Options options = webDriver.manage(); WebDriver.Timeouts timeouts = options.timeouts(); timeouts.implicitlyWait(GetterUtil.getInteger(timeout), TimeUnit.MILLISECONDS); }
public static void setTimeoutImplicit(WebDriver webDriver, String timeout) { WebDriver.Options options = webDriver.manage(); WebDriver.Timeouts timeouts = options.timeouts(); if (!PropsValues.BROWSER_TYPE.equals("safari")) { timeouts.implicitlyWait(GetterUtil.getInteger(timeout), TimeUnit.MILLISECONDS); } }
@Override public void setTimeout(Timeout timeout) { WebDriver.Timeouts tm = getDriver().manage().timeouts(); if (timeout.getWait() != 0) { tm.implicitlyWait(timeout.getWait(), TimeUnit.SECONDS); } if (timeout.getScript() != 0) { tm.setScriptTimeout(timeout.getScript(), TimeUnit.SECONDS); } if (timeout.getLoad() != 0) { tm.pageLoadTimeout(timeout.getLoad(), TimeUnit.SECONDS); } }
/** Set the default timeout on the selenium instance. */ private void setTimeoutOnSelenium() { executeCommand("setTimeout", new String[] {"" + this.timeout}); WebDriver.Timeouts timeouts = getWebDriver().manage().timeouts(); timeouts.setScriptTimeout(this.timeout, TimeUnit.MILLISECONDS); timeouts.pageLoadTimeout(this.timeout, TimeUnit.MILLISECONDS); }