Class InputSpecification


  • public final class InputSpecification
    extends Object
    Specifies values for form input fields The user specifies the ids or names of the input fields. When Crawljax enters a new state it scans the DOM for input fields and tries to match the field ids/names to the specified input fields. When there is a match, Crawljax enters the specified value EXAMPLE: HTML:
     
     Name: <input type="text" id="name" /><br />
     Phone: <input name="phone" /><br />
     Mobile: <input name="mobile" /><br />
     Agree to licence: <input id="agreelicence" type="checkbox" /><br />
     Other:content
     
     
    JAVA:
     
     InputSpecification input = new InputSpecification();
     //for fields with text
     input.field("name").setValue("John Doe");
     input.field("phone", "mobile").setValue("1234567890");
     //for checkboxes
     input.field("agreelicence").setValue(true);
     
     
    Crawljax will set Name, Phone, Mobile, and Agree values. It will enter a random string in the Other field if enabled in CrawljaxConfiguration
    • Constructor Detail

      • InputSpecification

        public InputSpecification()
    • Method Detail

      • setValuesInForm

        public FormAction setValuesInForm​(Form form)
        Links the form with an HTML element which can be clicked.
        Parameters:
        form - the collection of the input fields
        Returns:
        a FormAction
        See Also:
        Form
      • getForms

        public com.google.common.collect.ImmutableList<Form> getForms()
      • getCrawlElements

        public com.google.common.collect.ImmutableList<CrawlElement> getCrawlElements()
        Returns:
        List of crawlelements.