public static final class CrawlRules.CrawlRulesBuilder extends Object
public CrawlRules.CrawlRulesBuilder insertRandomDataInInputForms(boolean insertRandomData)
public CrawlRules.CrawlRulesBuilder dontCrawlFrame(String frame)
frame - A frame that should be excluded from the DOM, before doing any other
operations.public CrawlRules.CrawlRulesBuilder addEventType(Eventable.EventType... eventTypes)
eventTypes - Add an Eventable.EventType that should be triggered by Crawljax. If none are
defined, it will only use Eventable.EventType.clickpublic CrawlRules.CrawlRulesBuilder addInvariant(Invariant... invariant)
public CrawlRules.CrawlRulesBuilder addInvariant(String description, Condition condition)
description - The invariants description.condition - The condition for the invariant.Invariant.Invariant(String, Condition)public CrawlRules.CrawlRulesBuilder addOracleComparator(OracleComparator... oracle)
public PreCrawlConfiguration.PreCrawlConfigurationBuilder addWaitCondition(WaitCondition... condition)
condition - add a WaitCondition.public PreCrawlConfiguration.PreCrawlConfigurationBuilder addCrawlCondition(CrawlCondition... condition)
condition - add a CrawlConditionpublic PreCrawlConfiguration.PreCrawlConfigurationBuilder addCrawlCondition(String description, Condition crawlCondition)
public PreCrawlConfiguration.PreCrawlConfigurationBuilder filterAttributeNames(String names)
names - add an attribute name you want to filter before parsing the dom.public CrawlRules.CrawlRulesBuilder setInputSpec(InputSpecification spec)
public CrawlRules.CrawlRulesBuilder testInvariantsWhileCrawling(boolean test)
test - Test the invariants while crawling or not. Default is true.public CrawlRules.CrawlRulesBuilder clickOnce(boolean once)
once - Set the crawler to interact with any element only once. Default is
truepublic CrawlRules.CrawlRulesBuilder clickElementsInRandomOrder(boolean randomize)
randomize - Click candidate elements derived from the DOM in random order in stead of in
the order that they are found.public CrawlRules.CrawlRulesBuilder crawlFrames(boolean frames)
frames - Crawl frames in a page. Default is true.public CrawlRules.CrawlRulesBuilder waitAfterReloadUrl(long time, TimeUnit unit)
time - The time to wait after a URL is loaded. Default is 500 milliseconds.unit - The time unit.public CrawlRules.CrawlRulesBuilder waitAfterEvent(long time, TimeUnit unit)
time - The time to wait after an event is fired. Default is 500 milliseconds.unit - The time unit.public CrawlRules.CrawlRulesBuilder crawlHiddenAnchors(boolean anchors)
false.
public CrawlElement click(String tagName)
tagName - CrawlActionsBuilder.click(java.lang.String)public CrawlRules.CrawlRulesBuilder click(String... tagNames)
tagNames - CrawlActionsBuilder.click(java.lang.String[])public CrawlRules.CrawlRulesBuilder clickDefaultElements()
CrawlActionsBuilder.clickDefaultElements()public CrawlElement dontClick(String tagName)
public CrawlActionsBuilder.ExcludeByParentBuilder dontClickChildrenOf(String tagname)
tagname - CrawlActionsBuilder.dontClickChildrenOf(java.lang.String)public CrawlRules.CrawlRulesBuilder followExternalLinks(boolean follow)
href element that points to an URL
outside of this website. This does not prevent JavaScript from opening an external URL.
Once the browser reaches an external URL it will not accept that URL as a new
state. Crawljax is not meant to crawl outside a website. This option exists so that you
can check all URLs for 404 errors.
follow - Set to true to follow exteranl urls. Default is false.public CrawljaxConfiguration.CrawljaxConfigurationBuilder endRules()
CrawljaxConfiguration.builderFor("http://example.com")
.crawlRules()
.followExternalLinks(true)
.endRules()
.build();
CrawljaxConfiguration.CrawljaxConfigurationBuilder to make method chaining easier.Copyright © 2007–2014. All rights reserved.