BasicPath¶
Methods¶
after¶
afterSibling¶
ancestorOf¶
and¶
-
public Path
and
(ElementProperty... prop)¶ Alias equivalent to that(). Added for readability. Example:
div.that(hasClass("a")).and(hasText("foo"));
Parameters: - prop – a list of element properties (constraints)
Returns: a new Path
before¶
beforeSibling¶
builder¶
-
public static PathBuilder
builder
()¶
childNumber¶
-
public static ChildNumber
childNumber
(Integer n)¶ the element is the nth child of its parent. Count starts at 1. For example:
childNumber(4).ofType(div.withClass("foo"))
Parameters: - n – the index of the child - starting at 1
Returns: a ChildNumber instance, which is used with as in the example.
childOf¶
containing¶
contains¶
customElement¶
descendantOf¶
firstOccurrenceOf¶
getElementProperties¶
-
public List<ElementProperty>
getElementProperties
()¶
immediatelyAfterSibling¶
immediatelyBeforeSibling¶
inside¶
insideTopLevel¶
lastOccurrenceOf¶
occurrenceNumber¶
-
public static GlobalOccurrenceNumber
occurrenceNumber
(Integer n)¶ used in the form : occurrenceNumber(4).of(myElement)). Return the nth occurrence of the element in the entire document. Count starts at 1. For example:
occurrenceNumber(3).of(listItem)
Parameters: - n – the number of occurrence
Returns: GlobalOccurrenceNumber instance, which is used as in the example.
or¶
parentOf¶
textNode¶
-
public static Path
textNode
(String text)¶ Define a text node in the DOM, with the given text. Typically you don’t need to use it, but it is relevant if you have something like:
Male Female input.immediatelyBeforeSibling(textNode("Male"));
Parameters: - text – the text in the node. Note that it is trimmed, and case insensitive.
Returns: a Path of a text node
that¶
-
public Path
that
(ElementProperty... prop)¶ returns a path with the provided properties. For example: div.that(hasText(“abc”), hasClass(“foo”));
Parameters: - prop –
- one or more properties. See ElementProperties documentation for details
Returns: a new path with the added constraints
- prop –