Ejemplo n.º 1
0
 @Override
 public void afterNavigateTo(String url, WebDriver driver) {
   StringBuilder builder = new StringBuilder();
   if (!AlertHandler.isAlertPresent(driver)) {
     if (url.equals(driver.getCurrentUrl())) {
       builder.append(
           "<tr class=\"success\"><td>Url after navigation</td><td>"
               + driver.getCurrentUrl()
               + "</td><td> <br/> &nbsp;</td></tr>");
       CommonUtils.appendTextToFile(logPath, builder.toString());
     } else {
       if (driver.getCurrentUrl().contains("data:text/html,chromewebdata ")) {
         driver.get(url);
       }
       logWarning("Url after navigation", driver.getCurrentUrl());
     }
   } else {
     logWarning("Url after navigation", "Unable to check URL after navigation - alert present");
   }
   logJSError(driver);
 }