Examples of crawlRules()


Examples of com.crawljax.core.configuration.CrawljaxConfiguration.CrawljaxConfigurationBuilder.crawlRules()

  public void testExtractExclude() throws Exception {
    CrawljaxConfigurationBuilder builder =
            CrawljaxConfiguration.builderFor(DEMO_SITE_SERVER.getSiteUrl());
    builder.crawlRules().click("a");
    builder.crawlRules().dontClick("div").withAttribute("id", "menubar");
    builder.crawlRules().clickOnce(true);
    CrawljaxConfiguration config = builder.build();

    CandidateElementExtractor extractor = newElementExtractor(config);
    browser.goToUrl(DEMO_SITE_SERVER.getSiteUrl());
View Full Code Here

Examples of com.crawljax.core.configuration.CrawljaxConfiguration.CrawljaxConfigurationBuilder.crawlRules()

  public void testExtractIframeContents() throws Exception {
    RunWithWebServer server = new RunWithWebServer("/site");
    server.before();
    CrawljaxConfigurationBuilder builder = CrawljaxConfiguration
            .builderFor(server.getSiteUrl().resolve("iframe/"));
    builder.crawlRules().click("a");
    CrawljaxConfiguration config = builder.build();

    CandidateElementExtractor extractor = newElementExtractor(config);
    browser.goToUrl(server.getSiteUrl().resolve("iframe/"));
    List<CandidateElement> candidates = extractor.extract(DUMMY_STATE);
View Full Code Here

Examples of com.crawljax.core.configuration.CrawljaxConfiguration.CrawljaxConfigurationBuilder.crawlRules()

  @Test
  public void whenNoFollowExternalUrlDoNotFollow() throws IOException, URISyntaxException {
    CrawljaxConfigurationBuilder builder =
            CrawljaxConfiguration.builderFor("http://example.com");
    builder.crawlRules().click("a");
    CrawljaxConfiguration config = builder.build();
    CandidateElementExtractor extractor = newElementExtractor(config);

    List<CandidateElement> extract = extractFromTestFile(extractor);
View Full Code Here

Examples of com.crawljax.core.configuration.CrawljaxConfiguration.CrawljaxConfigurationBuilder.crawlRules()

  @Test
  public void whenFollowExternalUrlDoFollow() throws IOException, URISyntaxException {
    CrawljaxConfigurationBuilder builder =
            CrawljaxConfiguration.builderFor("http://example.com");
    builder.crawlRules().click("a");
    builder.crawlRules().followExternalLinks(true);
    CrawljaxConfiguration config = builder.build();
    CandidateElementExtractor extractor = newElementExtractor(config);

    List<CandidateElement> extract = extractFromTestFile(extractor);
View Full Code Here

Examples of com.crawljax.core.configuration.CrawljaxConfiguration.CrawljaxConfigurationBuilder.crawlRules()

  @Test
  public void whenFollowExternalUrlDoFollow() throws IOException, URISyntaxException {
    CrawljaxConfigurationBuilder builder =
            CrawljaxConfiguration.builderFor("http://example.com");
    builder.crawlRules().click("a");
    builder.crawlRules().followExternalLinks(true);
    CrawljaxConfiguration config = builder.build();
    CandidateElementExtractor extractor = newElementExtractor(config);

    List<CandidateElement> extract = extractFromTestFile(extractor);
View Full Code Here

Examples of com.crawljax.core.configuration.CrawljaxConfiguration.CrawljaxConfigurationBuilder.crawlRules()

    CrawljaxConfigurationBuilder builder =
            CrawljaxConfiguration.builderFor("http://example.com")
                    .addPlugin(new CrawlOverview())
                    .setOutputDirectory(tmpFolder.getRoot());

    builder.crawlRules().addCrawlCondition(
            new CrawlCondition("kers", new RegexCondition("test")));

    builder.crawlRules().addOracleComparator(
            new OracleComparator("tes", new SimpleComparator()));
View Full Code Here

Examples of com.crawljax.core.configuration.CrawljaxConfiguration.CrawljaxConfigurationBuilder.crawlRules()

                    .setOutputDirectory(tmpFolder.getRoot());

    builder.crawlRules().addCrawlCondition(
            new CrawlCondition("kers", new RegexCondition("test")));

    builder.crawlRules().addOracleComparator(
            new OracleComparator("tes", new SimpleComparator()));

    Serializer.toPrettyJson(builder.build());
  }
}
View Full Code Here

Examples of com.crawljax.core.configuration.CrawljaxConfiguration.CrawljaxConfigurationBuilder.crawlRules()

      @Override
      public void onInvariantViolation(Invariant invariant, CrawlerContext context) {
        hit = true;
      }
    });
    builder.crawlRules().addInvariant(new Invariant("Test123", new Condition() {

      @Override
      public boolean check(EmbeddedBrowser browser) {
        return false;
      }
View Full Code Here

Examples of com.crawljax.core.configuration.CrawljaxConfiguration.CrawljaxConfigurationBuilder.crawlRules()

  @Test
  public void testPopups() throws CrawljaxException {
    CrawljaxConfigurationBuilder builder =
            CrawljaxConfiguration.builderFor(WEB_SERVER.getSiteUrl().resolve("popup"));
    builder.setMaximumDepth(3);
    builder.crawlRules().click("a");
    builder.crawlRules().waitAfterEvent(100, TimeUnit.MILLISECONDS);
    builder.crawlRules().waitAfterReloadUrl(100, TimeUnit.MILLISECONDS);
    CrawljaxRunner runner = new CrawljaxRunner(builder.build());
    CrawlSession session = runner.call();
    assertThat(session.getStateFlowGraph(), hasEdges(2));
View Full Code Here

Examples of com.crawljax.core.configuration.CrawljaxConfiguration.CrawljaxConfigurationBuilder.crawlRules()

  public void testPopups() throws CrawljaxException {
    CrawljaxConfigurationBuilder builder =
            CrawljaxConfiguration.builderFor(WEB_SERVER.getSiteUrl().resolve("popup"));
    builder.setMaximumDepth(3);
    builder.crawlRules().click("a");
    builder.crawlRules().waitAfterEvent(100, TimeUnit.MILLISECONDS);
    builder.crawlRules().waitAfterReloadUrl(100, TimeUnit.MILLISECONDS);
    CrawljaxRunner runner = new CrawljaxRunner(builder.build());
    CrawlSession session = runner.call();
    assertThat(session.getStateFlowGraph(), hasEdges(2));
    assertThat(session.getStateFlowGraph(), hasStates(3));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.