コード例 #1
0
 @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);
   }
 }
コード例 #2
0
 /** 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);
 }