Class CrawlActionsBuilder


  • public class CrawlActionsBuilder
    extends Object
    • Constructor Detail

      • CrawlActionsBuilder

        CrawlActionsBuilder()
    • Method Detail

      • click

        public CrawlElement click​(String tagName)
        Set of HTML elements Crawljax will click during crawling For example 1) >a.../< 2) <div/> click("a") will only include 1 if clickOnce is true (default). This set can be restricted by dontClick(String).
        Parameters:
        tagName - the tag name of the elements to be included
        Returns:
        this CrawlElement
      • click

        public void click​(String... tagNames)
        Set of HTML elements Crawljax will click during crawling For example 1) <a.../> 2) <div/> click("a") will only include 1 This set can be restricted by dontClick(String). If no clicks are specified, clickDefaultElements() is enabled.
        Parameters:
        tagNames - the tag name of the elements to be included
      • clickDefaultElements

        public void clickDefaultElements()
        Includes HTML elements with Tags - Anchor, Button, Input.Submit, Input.Button Specifies that Crawljax should click all the default clickable elements. These include: All anchor tags All buttons
      • clickElementsWithClickEventHandler

        public void clickElementsWithClickEventHandler()
        Adds all HTML elements with a "click" event handler. Includes all default elements. see clickDefaultElements()
      • checkNotRead

        private void checkNotRead()
      • dontClick

        public CrawlElement dontClick​(String tagName)
        Set of HTML elements Crawljax will NOT click during crawling When an HTML is present in the click and dontClick sets, then the element will not be clicked. For example: 1) <a href="#">Some text</a> 2) <a class="foo" .../> 3) <div class="foo" .../> click("a") dontClick("a").withAttribute("class", "foo"); Will include only include HTML element 2
        Parameters:
        tagName - the tag name of the elements to be excluded
        Returns:
        crawlTag the CrawlElement
      • dontClickChildrenOf

        public CrawlActionsBuilder.ExcludeByParentBuilder dontClickChildrenOf​(String tagName)
        Click no children of the specified parent element.
        Parameters:
        tagName - The tag name of which no children should be clicked.
        Returns:
        The builder to append more options.
      • getCrawlElements

        private com.google.common.collect.ImmutableList<CrawlElement> getCrawlElements()
        Returns:
        the crawlElements.
      • getCrawlElementsExcluded

        private com.google.common.collect.ImmutableList<CrawlElement> getCrawlElementsExcluded()
        Returns:
        the crawlElementsExcluded
      • build

        org.apache.commons.lang3.tuple.Pair<com.google.common.collect.ImmutableList<CrawlElement>,​com.google.common.collect.ImmutableList<CrawlElement>> build()
        Returns:
        a Pair where Pair.getLeft() are the includes and Pair.getRight() are the excludes.