| Modifier and Type | Class and Description |
|---|---|
static class |
BasicPath.ChildNumber
Allows to define an element that has a predefined number of similar preceding siblings.
|
static class |
BasicPath.GlobalOccurrenceNumber
Not to be used directly, but through the utility functions:
firstOccurrenceOf(Path), lastOccurrenceOf(Path), occurrenceNumber(Integer) |
static class |
BasicPath.PathBuilder
A builder for BasicPath.
|
| Modifier and Type | Field and Description |
|---|---|
static BasicPath |
anchor
An anchor(or "a") element
|
static BasicPath |
body |
static BasicPath |
button |
static BasicPath |
div |
static BasicPath |
element
Any element
|
static BasicPath |
form |
static BasicPath |
header
Any header element
|
static BasicPath |
header1 |
static BasicPath |
header2 |
static BasicPath |
header3 |
static BasicPath |
header4 |
static BasicPath |
header5 |
static BasicPath |
header6 |
static BasicPath |
html |
static BasicPath |
iframe |
static BasicPath |
image |
static BasicPath |
input |
static BasicPath |
label |
static BasicPath |
listItem
An "li" element
|
static BasicPath |
option |
static BasicPath |
section |
static BasicPath |
select |
static BasicPath |
span |
static BasicPath |
svg |
static BasicPath |
table |
static BasicPath |
td |
static BasicPath |
th |
static BasicPath |
title |
static BasicPath |
tr |
static BasicPath |
unorderedList
An "ul" element
|
| Modifier and Type | Method and Description |
|---|---|
Path |
after(Path path)
The element appears after the given path
|
Path |
afterSibling(Path path)
The element has a preceding sibling that matches to the given Path parameter
|
Path |
ancestorOf(Path path)
The element contains the given path, i.e.
|
Path |
and(ElementProperty... prop)
Alias equivalent to that().
|
Path |
before(Path path)
The element is before the given path parameter
|
Path |
beforeSibling(Path path)
The element is a sibling of the given path and appears before it
|
static BasicPath.PathBuilder |
builder() |
static BasicPath.ChildNumber |
childNumber(Integer n)
the element is the nth child of its parent.
|
Path |
childOf(Path path)
The element is a direct child of the given path
|
Path |
containing(Path path)
The element contains the given path, i.e.
|
Path |
contains(Path path)
The element contains the given path, i.e.
|
static BasicPath |
customElement(String el)
Create a custom element Path using a simple API instead of the builder pattern.
|
static BasicPath |
customNameSpaceElement(String el) |
Path |
descendantOf(Path path)
The element is inside the given path parameter
|
Path |
describedBy(String description)
A useful method to give a readable description to the path, for example:
Suppose that instead of describing it's DOM positions and attributes, you prefer to describe it as "search result".
|
static Path |
firstOccurrenceOf(Path path)
First global occurrence of an element in the document.
|
Optional<String> |
getAlternateXPath() |
Optional<String> |
getDescribedBy() |
List<ElementProperty> |
getElementProperties() |
Optional<org.openqa.selenium.WebElement> |
getUnderlyingSource() |
Optional<String> |
getXPath()
The Optional xpath is maps to.
|
Optional<String> |
getXpathExplanation() |
Path |
immediatelyAfterSibling(Path path)
The sibling right before the current element matches to the given Path parameter
|
Path |
immediatelyBeforeSibling(Path path)
The sibling right after the element matches the given path parameter
|
Path |
inside(Path path)
Element that is inside another element
|
Path |
insideTopLevel()
Returns an element that is explicitly inside the document.
|
static Path |
lastOccurrenceOf(Path path)
Last global occurrence of an element in the document
|
static BasicPath.GlobalOccurrenceNumber |
occurrenceNumber(Integer n)
used in the form : occurrenceNumber(4).of(myElement)).
|
Path |
or(Path path)
match more than a single path.
|
Path |
parentOf(Path path)
The element is a parent of the given path
|
Path |
that(ElementProperty... prop)
returns a path with the provided properties.
|
String |
toString() |
Path |
withClass(String cssClass)
Equivalent to
this.that(hasClass(cssClass)) |
Path |
withClasses(String... cssClasses)
Equivalent to
this.that(hasClasses(cssClasses)) |
Path |
withGlobalIndex(Integer n)
An alias of:
occurrenceNumber(n + 1).of(this) |
Path |
withText(String txt)
Element with text equals (ignoring case) to txt.
|
Path |
withTextContaining(String txt)
Equivalent to
this.that(hasTextContaining(txt)). |
public static final BasicPath element
public static final BasicPath div
public static final BasicPath span
public static final BasicPath image
public static final BasicPath listItem
public static final BasicPath button
public static final BasicPath unorderedList
public static final BasicPath input
public static final BasicPath anchor
public static final BasicPath form
public static final BasicPath iframe
public static final BasicPath html
public static final BasicPath body
public static final BasicPath header1
public static final BasicPath header2
public static final BasicPath header3
public static final BasicPath header4
public static final BasicPath header5
public static final BasicPath header6
public static final BasicPath header
public static final BasicPath title
public static final BasicPath tr
public static final BasicPath td
public static final BasicPath th
public static final BasicPath table
public static final BasicPath select
public static final BasicPath option
public static final BasicPath label
public static final BasicPath section
public static final BasicPath svg
public static BasicPath.PathBuilder builder()
public static BasicPath customElement(String el)
Path myDiv = customElement("div");
el - - the element type in W3C. will be used for the toString as well.public static BasicPath.ChildNumber childNumber(Integer n)
childNumber(4).ofType(div.withClass("foo"))
n - the index of the child - starting at 1public static BasicPath.GlobalOccurrenceNumber occurrenceNumber(Integer n)
occurrenceNumber(3).of(listItem)
n - the number of occurrencepublic static Path firstOccurrenceOf(Path path)
path - the element to findpublic static Path lastOccurrenceOf(Path path)
path - the element to findpublic Optional<String> getXPath()
Pathpublic Optional<String> getAlternateXPath()
getAlternateXPath in interface Pathpublic Optional<org.openqa.selenium.WebElement> getUnderlyingSource()
getUnderlyingSource in interface Pathpublic Optional<String> getXpathExplanation()
getXpathExplanation in interface Pathpublic Optional<String> getDescribedBy()
getDescribedBy in interface Pathpublic List<ElementProperty> getElementProperties()
getElementProperties in interface Pathpublic Path describedBy(String description)
PathdescribedBy in interface Pathdescription - a readable description to that expresses the functionality of the pathpublic Path or(Path path)
public Path that(ElementProperty... prop)
public Path and(ElementProperty... prop)
div.that(hasClass("a")).and(hasText("foo"));
public Path withText(String txt)
path.that(hasText(txt))
public Path insideTopLevel()
insideTopLevel in interface Pathpublic Path afterSibling(Path path)
afterSibling in interface Pathpath - - the sibling element that appears beforepublic Path immediatelyAfterSibling(Path path)
immediatelyAfterSibling in interface Pathpath - - the sibling element that appears right beforepublic Path beforeSibling(Path path)
beforeSibling in interface Pathpath - - the sibling element that appears afterpublic Path immediatelyBeforeSibling(Path path)
immediatelyBeforeSibling in interface Pathpath - - the sibling element that appears afterpublic Path childOf(Path path)
Pathpublic Path parentOf(Path path)
Pathpublic Path containing(Path path)
Pathcontaining in interface Pathpath - - the element that is inside our elementpublic Path contains(Path path)
Pathpublic Path ancestorOf(Path path)
PathancestorOf in interface Pathpath - - the element that is inside our elementpublic Path descendantOf(Path path)
descendantOf in interface Pathpath - - the element that is wrapping our elementpublic Path withGlobalIndex(Integer n)
occurrenceNumber(n + 1).of(this) withGlobalIndex in interface Pathn - - the global occurrence index of the path, starting from 0public Path withClasses(String... cssClasses)
this.that(hasClasses(cssClasses)) withClasses in interface PathcssClasses - the class namespublic Path withTextContaining(String txt)
this.that(hasTextContaining(txt)).withTextContaining in interface Pathtxt - the text to match to. The match is case insensitive.Copyright © 2018. All rights reserved.