Package com.crawljax.core

Examples of com.crawljax.core.CrawljaxException


   *             when not can be determined whether xpath contains needed xpath locaton
   */
  public boolean checkXpathStartsWithXpathEventableCondition(Document dom,
          EventableCondition eventableCondition, String xpath) throws XPathExpressionException {
    if (eventableCondition == null || Strings.isNullOrEmpty(eventableCondition.getInXPath())) {
      throw new CrawljaxException("Eventable has no XPath condition");
    }
    List<String> expressions =
            XPathHelper.getXpathForXPathExpressions(dom, eventableCondition.getInXPath());

    return checkXPathUnderXPaths(xpath, expressions);
View Full Code Here


    try {
      Field f = superclass.getDeclaredField(fieldName);
      f.setAccessible(true);
      f.set(this, source);
    } catch (ReflectiveOperationException e) {
      throw new CrawljaxException("Could not set the source field", e);
    }
  }
View Full Code Here

    URL sampleSites = BaseCrawler.class.getResource("/site");
    LOG.debug("Loading web server with from folder {}", sampleSites.toExternalForm());
    try {
      this.webServer = new WebServer(Resource.newResource(sampleSites));
    } catch (IOException e) {
      throw new CrawljaxException("Could not load resource", e);
    }
  }
View Full Code Here

    } else {
      LOG.debug("Loading skeleton as file");
      try {
        FileUtils.copyDirectory(new File(skeleton.toURI()), outputDir);
      } catch (IOException | URISyntaxException e) {
        throw new CrawljaxException(
                "Could not copy required resources: " + e.getMessage(), e);
      }
    }

  }
View Full Code Here

          ByteStreams.copy(zis, out);
          out.close();
        }
      }
    } catch (IOException e1) {
      throw new CrawljaxException("Could not copy required resources: " + e1.getMessage(),
              e1);
    }
  }
View Full Code Here

  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

    site = BaseCrawler.class.getResource("/site").toURI();
    try {
      server = new WebServer(Resource.newResource(site));
    }
    catch (IOException e) {
      throw new CrawljaxException("Could not load resource", e);
    }
    server.start();
  }
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 = Helper.getDocument(browser.getPageSource());
      appendFrameContent(document.getDocumentElement(), document, "");
      return document;
    } catch (SAXException e) {
      throw new CrawljaxException(e.getMessage(), e);
    } catch (IOException e) {
      throw new CrawljaxException(e.getMessage(), e);
    }

  }
View Full Code Here

      File tmpfile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);

      try {
        FileHandler.copy(tmpfile, file);
      } catch (IOException e) {
        throw new CrawljaxException(e);
      }

      removeCanvasGeneratedByFirefoxDriverForScreenshots();
    } else if (driver instanceof RemoteWebDriver) {
      WebDriver augmentedWebdriver = new Augmenter().augment(driver);
      takeScreenShotOnBrowser(augmentedWebdriver, file);
    } else if (driver instanceof WrapsDriver) {
      takeScreenShotOnBrowser(((WrapsDriver) driver).getWrappedDriver(), file);
    } else {
      throw new CrawljaxException("Your current WebDriver doesn't support screenshots.");
    }
  }
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.