Exemplo n.º 1
0
 protected URL prepareRemoteUrl() {
   URL url = null;
   if (CustomProperties.getRemote() != null) {
     url = URLUtils.getURL(CustomProperties.getRemote());
   }
   return url;
 }
Exemplo n.º 2
0
  private RemoteWebDriver invokeDriverCreationTask(Callable<RemoteWebDriver> task) {
    int timeout = CustomProperties.getDriverTimeoutCreation(); // in seconds

    RemoteWebDriver driver = FutureTaskUtils.invokeTask(task, timeout);

    if (driver == null) {
      log.warn("Failed to created WebDriver instance, will try one more time.");
    }
    return driver;
  }
Exemplo n.º 3
0
  public RemoteWebDriver startDriver(Callable<RemoteWebDriver> task) {
    RemoteWebDriver driver = invokeDriverCreationTask(task);

    int driverCreationAttempts = CustomProperties.getDriverCreationAttempts();
    int counter = 0;
    while (driver == null && counter != driverCreationAttempts) {
      driver = invokeDriverCreationTask(task);
      counter++;

      if (counter == driverCreationAttempts && driver == null)
        throw new WebDriverException(
            "Failed to create new instance of WebDriver after "
                + driverCreationAttempts
                + " attempts!");
    }
    return driver;
  }