| Modifier and Type | Field and Description |
|---|---|
static SingleBrowserPath |
anchor |
static SingleBrowserPath |
body |
static SingleBrowserPath |
button |
static SingleBrowserPath |
div |
static SingleBrowserPath |
element |
static SingleBrowserPath |
form |
static SingleBrowserPath |
header |
static SingleBrowserPath |
header1 |
static SingleBrowserPath |
header2 |
static SingleBrowserPath |
header3 |
static SingleBrowserPath |
header4 |
static SingleBrowserPath |
header5 |
static SingleBrowserPath |
header6 |
static SingleBrowserPath |
html |
static SingleBrowserPath |
input |
static SingleBrowserPath |
listItem |
static SingleBrowserPath |
section |
static SingleBrowserPath |
span |
static SingleBrowserPath |
svg |
static SingleBrowserPath |
unorderedList |
| Constructor and Description |
|---|
SingleBrowserPath(BasicPath path) |
| Modifier and Type | Method and Description |
|---|---|
Path |
after(Path another)
The element appears after the given path
|
Path |
afterSibling(Path another)
The element is a sibling of the given path, and appears after it
|
Path |
ancestorOf(Path another)
The element contains the given path, i.e.
|
Path |
and(ElementProperty... prop)
Alias equivalent to
Path.that(com.github.loyada.jdollarx.ElementProperty...). |
Path |
before(Path another)
The element appears before the given path
|
Path |
beforeSibling(Path another)
The element is a sibling of the given path, and appears before it
|
Path |
childOf(Path another)
The element is a direct child of the given path
|
void |
click()
click at the location of this element
|
Path |
containing(Path another)
The element contains the given path, i.e.
|
Path |
contains(Path another)
The element contains the given path, i.e.
|
Path |
descendantOf(Path another)
The element is contained in the given path element, i.e.
|
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".
|
void |
doubleClick()
doubleclick at the location of this element
|
Operations.DragAndDrop |
dragAndDrop()
drag and drop this element, to another element or another location.
|
org.openqa.selenium.WebElement |
find()
Find the (first) element in the browser for this path
|
List<org.openqa.selenium.WebElement> |
findAll()
Find all elements in the browser with this path
|
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() |
void |
hover()
hover over the element with this path in the browser
|
Path |
immediatelyAfterSibling(Path another)
The sibling right before the element matches the given path parameter
|
Path |
immediatelyBeforeSibling(Path another)
The sibling right after the element matches the given path parameter
|
Path |
inside(Path another)
Element that is inside another element
|
Path |
insideTopLevel()
Returns an element that is explicitly inside the document.
|
Path |
or(Path another)
match more than a single path.
|
Path |
parentOf(Path another)
The element is a parent of the given path
|
org.openqa.selenium.WebElement |
scrollTo()
scroll the browser until this element is visible
|
void |
sendKeys(CharSequence... charsToSend)
send keys to element
|
Path |
that(ElementProperty... prop)
returns a path with the provided properties.
|
String |
toString() |
Path |
withClass(String cssClass)
The element has the given class name
|
Path |
withClasses(String... cssClasses)
The element has the given class names
|
Path |
withGlobalIndex(Integer index)
Return the nth occurrence of the element in the entire document.
|
Path |
withText(String txt)
Element with text equals (ignoring case) to txt.
|
Path |
withTextContaining(String txt)
The element has text, containing the given txt parameter.
|
public static final SingleBrowserPath element
public static final SingleBrowserPath div
public static final SingleBrowserPath span
public static final SingleBrowserPath listItem
public static final SingleBrowserPath button
public static final SingleBrowserPath unorderedList
public static final SingleBrowserPath input
public static final SingleBrowserPath anchor
public static final SingleBrowserPath form
public static final SingleBrowserPath html
public static final SingleBrowserPath body
public static final SingleBrowserPath header1
public static final SingleBrowserPath header2
public static final SingleBrowserPath header3
public static final SingleBrowserPath header4
public static final SingleBrowserPath header5
public static final SingleBrowserPath header6
public static final SingleBrowserPath header
public static final SingleBrowserPath svg
public static final SingleBrowserPath section
public SingleBrowserPath(BasicPath path)
public Optional<org.openqa.selenium.WebElement> getUnderlyingSource()
getUnderlyingSource in interface Pathpublic Optional<String> getXpathExplanation()
getXpathExplanation in interface Pathpublic Optional<String> getDescribedBy()
getDescribedBy in interface Pathpublic Optional<String> getAlternateXPath()
getAlternateXPath in interface Pathpublic Optional<String> getXPath()
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 insideTopLevel()
PathinsideTopLevel in interface Pathpublic Path or(Path another)
Pathpublic Path that(ElementProperty... prop)
Pathpublic Path and(ElementProperty... prop)
PathPath.that(com.github.loyada.jdollarx.ElementProperty...). Added for readability.
Example:
div.that(hasClass("a")).and(hasText("foo"));
public Path inside(Path another)
Pathpublic Path afterSibling(Path another)
PathafterSibling in interface Pathanother - - the sibling element that appears beforepublic Path immediatelyAfterSibling(Path another)
PathimmediatelyAfterSibling in interface Pathanother - - the sibling element that appears afterpublic Path after(Path another)
Pathpublic Path beforeSibling(Path another)
PathbeforeSibling in interface Pathanother - - the sibling element that appears afterpublic Path immediatelyBeforeSibling(Path another)
PathimmediatelyBeforeSibling in interface Pathanother - - the sibling element that appears afterpublic Path before(Path another)
Pathpublic Path childOf(Path another)
Pathpublic Path parentOf(Path another)
Pathpublic Path containing(Path another)
Pathcontaining in interface Pathanother - - the element that is inside our elementpublic Path contains(Path another)
Pathpublic Path ancestorOf(Path another)
PathancestorOf in interface Pathanother - - the element that is inside our elementpublic Path descendantOf(Path another)
PathdescendantOf in interface Pathanother - - the element that is wrapping our elementpublic Path withGlobalIndex(Integer index)
PathwithGlobalIndex in interface Pathindex - the number of occurrencepublic Path withClass(String cssClass)
Pathpublic Path withClasses(String... cssClasses)
PathwithClasses in interface PathcssClasses - the class namespublic Path withText(String txt)
Pathpath.that(hasText(txt)) public Path withTextContaining(String txt)
PathwithTextContaining in interface Pathtxt - the text to match topublic org.openqa.selenium.WebElement find()
public List<org.openqa.selenium.WebElement> findAll()
public org.openqa.selenium.WebElement scrollTo()
public void hover()
public void click()
public void doubleClick()
public Operations.DragAndDrop dragAndDrop()
element.dragAndDrop().to(anotherElement);
element.dragAndDrop().to(50, 50);
public void sendKeys(CharSequence... charsToSend) throws Operations.OperationFailedException
charsToSend - the keys to send.
Examples:
input.sendKeys("abc");
input.sendKeys("a", "bc");
Operations.OperationFailedException - - operation failed. Includes root cause.Copyright © 2018. All rights reserved.