Package com.crawljax.core.configuration
Class InputSpecification
- java.lang.Object
-
- com.crawljax.core.configuration.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:
JAVA: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
Crawljax will set Name, Phone, Mobile, and Agree values. It will enter a random string in the Other field if enabled inInputSpecification 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);CrawljaxConfiguration
-
-
Field Summary
Fields Modifier and Type Field Description private Map<Identification,FormInput>formInputsprivate List<Form>forms
-
Constructor Summary
Constructors Constructor Description InputSpecification()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableList<CrawlElement>getCrawlElements()Map<Identification,FormInput>getFormInputs()com.google.common.collect.ImmutableList<Form>getForms()FormInputinputField(FormInput input)FormInputinputField(FormInput.InputType type, Identification identification)FormActionsetValuesInForm(Form form)Links the form with an HTML element which can be clicked.
-
-
-
Field Detail
-
formInputs
private final Map<Identification,FormInput> formInputs
-
-
Method Detail
-
inputField
public FormInput inputField(FormInput.InputType type, Identification identification)
-
getFormInputs
public Map<Identification,FormInput> getFormInputs()
-
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.
-
-