Package com.crawljax.core

Examples of com.crawljax.core.CrawljaxException


  private File getJar(URL skeleton) {
    String path;
    try {
      path = URLDecoder.decode(skeleton.getPath(), "UTF-8");
    } catch (UnsupportedEncodingException e) {
      throw new CrawljaxException("Could not process the path of the Overview skeleton "
              + skeleton, e);
    }
    String jarpath = path.substring("file:".length(), path.indexOf("jar!") + "jar".length());
    File jar = new File(jarpath);
    LOG.debug("Jar file {} from path {}", jar, path);
View Full Code Here


  private String getCrawljaxVersion() {
    try {
      return Resources
              .toString(JarRunner.class.getResource("/project.version"), Charsets.UTF_8);
    } catch (IOException e) {
      throw new CrawljaxException(e.getMessage(), e);
    }
  }
View Full Code Here

      if (commandLine.hasOption(OVERRIDE)) {
        System.out.println("Overriding output directory...");
        try {
          FileUtils.deleteDirectory(out);
        } catch (IOException e) {
          throw new CrawljaxException(e.getMessage(), e);
        }
      } else {
        throw new IllegalStateException(
                "Output directory is not empty. If you want to override, use the -override option");
      }
View Full Code Here

        if (!f.exists()) {
          Files.createParentDirs(f);
          Files.touch(f);
        }
      } catch (IOException e) {
        throw new CrawljaxException("Could not create log file: " + e.getMessage(), e);
      }
      Preconditions.checkArgument(f.canWrite());
      LogUtil.logToFile(f.getPath());
    }
View Full Code Here

    try {
      JavascriptExecutor js = (JavascriptExecutor) browser;
      return js.executeScript(code);
    } catch (WebDriverException e) {
      throwIfConnectionException(e);
      throw new CrawljaxException(e);
    }
  }
View Full Code Here

    try {
      Document document = DomUtils.asDocument(browser.getPageSource());
      appendFrameContent(document.getDocumentElement(), document, "");
      return document;
    } catch (IOException e) {
      throw new CrawljaxException(e.getMessage(), e);
    }

  }
View Full Code Here

    try {
      File tmpfile = takeScreenShotOnBrowser(browser, OutputType.FILE);
      try {
        FileHandler.copy(tmpfile, file);
      } catch (IOException e) {
        throw new CrawljaxException(e);
      }
    } catch (WebDriverException e) {
      throw wrapWebDriverExceptionIfConnectionException(e);
    }
  }
View Full Code Here

      WebDriver augmentedWebdriver = new Augmenter().augment(driver);
      return takeScreenShotOnBrowser(augmentedWebdriver, outType);
    } else if (driver instanceof WrapsDriver) {
      return takeScreenShotOnBrowser(((WrapsDriver) driver).getWrappedDriver(), outType);
    } else {
      throw new CrawljaxException("Your current WebDriver doesn't support screenshots.");
    }
  }
View Full Code Here

  private StateVertix getSuperField(String name) throws CrawljaxException {
    try {
      return (StateVertix) searchSuperField(name).get(this);
    } catch (IllegalArgumentException e) {
      throw new CrawljaxException(e.getMessage(), e);
    } catch (IllegalAccessException e) {
      throw new CrawljaxException(e.getMessage(), e);
    }

  }
View Full Code Here

    try {
      JavascriptExecutor js = (JavascriptExecutor) browser;
      return js.executeScript(code);
    } catch (WebDriverException e) {
      throwIfConnectionException(e);
      throw new CrawljaxException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.crawljax.core.CrawljaxException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.