Package com.crawljax.core.configuration.CrawljaxConfiguration

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


    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());

    List<CandidateElement> candidates = extractor.extract(DUMMY_STATE);
View Full Code Here


    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

  @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);

    assertThat(config.getCrawlRules().followExternalLinks(), is(false));
View Full Code Here

  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);

    assertThat(config.getCrawlRules().followExternalLinks(), is(true));
View Full Code Here

            new CrawlCondition("kers", new RegexCondition("test")));

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

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

      @Override
      public boolean check(EmbeddedBrowser browser) {
        return false;
      }
    }));
    setStateMachineForConfig(builder.build());

    // state2.equals(state3)
    StateVertex state2 = new StateVertexImpl(2, "state2", "<table><div>state2</div></table>");
    StateVertex state3 = new StateVertexImpl(3, "state3", "<table><div>state2</div></table>");
View Full Code Here

            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

      builder.crawlRules().click(options.getSpecifiedClickElements());
    } else {
      builder.crawlRules().clickDefaultElements();
    }

    return builder.build();
  }

  private void configureTimers(CrawljaxConfigurationBuilder builder) {
    if (options.specifiesTimeOut()) {
      builder.setMaximumRunTime(options.getSpecifiedTimeOut(), TimeUnit.MINUTES);
View Full Code Here

            record.getPlugins().put(pluginKey, plugin);
          }
        }

        // Build Crawljax
        CrawljaxRunner crawljax = new CrawljaxRunner(builder.build());

        // Set Timestamps
        timestamp = new Date();
        record.setStartTime(timestamp);
        record.setCrawlStatus(CrawlStatusType.running);
View Full Code Here

    addOracleComparators(builder);
    addInvariants(builder);
    addWaitConditions(builder);
    addPlugins(builder);

    return builder.build();
  }

  private static InputSpecification getInputSpecification() {
    InputSpecification input = new InputSpecification();
    input.field("textManual").setValue(MANUAL_INPUT_TEXT);
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.