public final class CrawlElement extends Object
CrawljaxConfiguration crawler = new CrawljaxConfiguration();
crawler.click("a");
crawler.click("div").withAttribute("class", "clickable");
crawler.dontClick("a").withText("id", "logout");
crawler.dontClick("a").underXpath("//DIV[@id='header']");
| Modifier | Constructor and Description |
|---|---|
protected |
CrawlElement(Eventable.EventType eventType,
String tagName)
To create a CrawlElement representing an HTML element MyLink the tag name would be
"a".
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addInputFieldIds(List<String> ids) |
protected String |
escapeApostrophes(String text)
Returns a string to resolve apostrophe issue in xpath
|
protected com.google.common.collect.ImmutableList<Condition> |
getConditions() |
EventableCondition |
getEventableCondition() |
Eventable.EventType |
getEventType() |
String |
getId() |
protected com.google.common.collect.ImmutableList<String> |
getInputFieldIds() |
String |
getTagName() |
String |
getWithXpathExpression() |
protected void |
setConditions(Condition... conditions)
Sets the conditions.
|
String |
toString() |
CrawlElement |
underXPath(String xpathExpression)
Restrict CrawlElement to include only HTML elements which are under HTML element X which
identified by the xpath expression xpathExpression When xpathExpression returns no HTML
elements this Crawltag is not considred under element X.
|
CrawlElement |
when(Condition... conditions)
Crawljax will crawl the HTML elements while crawling if and only if all the specified
conditions are satisfied.
|
CrawlElement |
withAttribute(String attributeName,
String value)
Restrict CrawlElement to include only HTML elements with the specified attribute.
|
CrawlElement |
withText(String text)
Restrict crawlTag to include only HTML elements which have the specified text For example 1)
Foo 2) Bar 3) Example 3a withText("Foo") will include element 1
withText("Example %") will include elements3 Text can support wild-card characters.
|
protected CrawlElement(Eventable.EventType eventType, String tagName)
eventType - the event type for this crawl element.public CrawlElement when(Condition... conditions)
conditions - the condition to be met.public CrawlElement withAttribute(String attributeName, String value)
attributeName - the name of the attributevalue - the value of the attributepublic CrawlElement underXPath(String xpathExpression)
xpathExpression - the xpath expression where the element should underpublic CrawlElement withText(String text)
text - Text that should be inside the element.public EventableCondition getEventableCondition()
public String getId()
public String getTagName()
public String getWithXpathExpression()
protected void setConditions(Condition... conditions)
conditions - The conditionsprotected com.google.common.collect.ImmutableList<Condition> getConditions()
protected com.google.common.collect.ImmutableList<String> getInputFieldIds()
protected void addInputFieldIds(List<String> ids)
ids - Sets the list of input field ids.public Eventable.EventType getEventType()
Copyright © 2007-2013. All Rights Reserved.