| Package | Description |
|---|---|
| com.github.loyada.jdollarx |
main package for defining Path DOM elements and browser interaction
|
| com.github.loyada.jdollarx.custommatchers |
Custom Hamcrest matchers for assertions in tests - supports multiple instances of browsers, as
well as assertions on a W3C Document
|
| com.github.loyada.jdollarx.singlebrowser |
Simplified API for interaction with a single instance of browser
|
| com.github.loyada.jdollarx.singlebrowser.custommatchers |
Custom Hamcrest matchers for assertions in tests - for a singleton instance of browser
|
| com.github.loyada.jdollarx.utils |
Utilities for troubleshooting
|
| Modifier and Type | Class and Description |
|---|---|
class |
BasicPath
The standard implementation of Path in DollarX
|
| Modifier and Type | Field and Description |
|---|---|
Path |
NPath.path |
| Modifier and Type | Method and Description |
|---|---|
Path |
BasicPath.after(Path path)
The element appears after the given path
|
Path |
Path.after(Path path)
The element appears after the given path
|
Path |
BasicPath.afterSibling(Path path)
The element has a preceding sibling that matches to the given Path parameter
|
Path |
Path.afterSibling(Path path)
The element is a sibling of the given path, and appears after it
|
Path |
BasicPath.ancestorOf(Path path) |
Path |
Path.ancestorOf(Path path)
The element contains the given path, i.e.
|
Path |
BasicPath.and(ElementProperty... prop)
Alias equivalent to that().
|
Path |
Path.and(ElementProperty... prop)
Alias equivalent to
that(com.github.loyada.jdollarx.ElementProperty...). |
Path |
BasicPath.before(Path path)
The element is before the given path parameter
|
Path |
Path.before(Path path)
The element appears before the given path
|
Path |
BasicPath.beforeSibling(Path path)
The element is a sibling of the given path and appears before it
|
Path |
Path.beforeSibling(Path path)
The element is a sibling of the given path, and appears before it
|
Path |
BasicPath.childOf(Path path) |
Path |
Path.childOf(Path path)
The element is a direct child of the given path
|
Path |
BasicPath.containing(Path path) |
Path |
Path.containing(Path path)
The element contains the given path, i.e.
|
Path |
BasicPath.contains(Path path) |
Path |
Path.contains(Path path)
The element contains the given path, i.e.
|
Path |
BasicPath.descendantOf(Path path)
The element is inside the given path parameter
|
Path |
Path.descendantOf(Path path)
The element is contained in the given path element, i.e.
|
Path |
BasicPath.describedBy(String description) |
Path |
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 |
BasicPath.firstOccurrenceOf(Path path)
First global occurrence of an element in the document.
|
Path |
BasicPath.immediatelyAfterSibling(Path path)
The sibling right before the current element matches to the given Path parameter
|
Path |
Path.immediatelyAfterSibling(Path path)
The sibling right before the element matches the given path parameter
|
Path |
BasicPath.immediatelyBeforeSibling(Path path)
The sibling right after the element matches the given path parameter
|
Path |
Path.immediatelyBeforeSibling(Path path)
The sibling right after the element matches the given path parameter
|
Path |
BasicPath.inside(Path path)
Element that is inside another element
|
Path |
Path.inside(Path path)
Element that is inside another element
|
Path |
BasicPath.insideTopLevel()
Returns an element that is explicitly inside the document.
|
Path |
Path.insideTopLevel()
Returns an element that is explicitly inside the document.
|
static Path |
BasicPath.lastOccurrenceOf(Path path)
Last global occurrence of an element in the document
|
static Path |
PathOperators.not(Path path)
Any element that does NOT conform to the definition of the given path parameters
|
Path |
BasicPath.GlobalOccurrenceNumber.of(Path path)
return the nth global occurrence (in the entire document) of the given path.
|
Path |
BasicPath.ChildNumber.ofType(Path path)
an element that has n similar preceding siblings.
|
Path |
BasicPath.or(Path path)
match more than a single path.
|
Path |
Path.or(Path path)
match more than a single path.
|
Path |
BasicPath.parentOf(Path path) |
Path |
Path.parentOf(Path path)
The element is a parent of the given path
|
Path |
BasicPath.that(ElementProperty... prop)
returns a path with the provided properties.
|
Path |
Path.that(ElementProperty... prop)
returns a path with the provided properties.
|
Path |
BasicPath.withClass(String cssClass)
Equivalent to
this.that(hasClass(cssClass)) |
Path |
Path.withClass(String cssClass)
The element has the given class name
|
Path |
BasicPath.withClasses(String... cssClasses)
Equivalent to
this.that(hasClasses(cssClasses)) |
Path |
Path.withClasses(String... cssClasses)
The element has the given class names
|
Path |
BasicPath.withGlobalIndex(Integer n)
An alias of:
occurrenceNumber(n + 1).of(this) |
Path |
Path.withGlobalIndex(Integer index)
Return the nth occurrence of the element in the entire document.
|
Path |
BasicPath.withText(String txt)
Element with text equals (ignoring case) to txt.
|
Path |
Path.withText(String txt)
Element with text equals (ignoring case) to txt.
|
Path |
BasicPath.withTextContaining(String txt)
Equivalent to
this.that(hasTextContaining(txt)). |
Path |
Path.withTextContaining(String txt)
The element has text, containing the given txt parameter.
|
| Modifier and Type | Method and Description |
|---|---|
Path |
BasicPath.after(Path path)
The element appears after the given path
|
Path |
Path.after(Path path)
The element appears after the given path
|
Path |
BasicPath.afterSibling(Path path)
The element has a preceding sibling that matches to the given Path parameter
|
Path |
Path.afterSibling(Path path)
The element is a sibling of the given path, and appears after it
|
Path |
BasicPath.ancestorOf(Path path) |
Path |
Path.ancestorOf(Path path)
The element contains the given path, i.e.
|
Path |
BasicPath.before(Path path)
The element is before the given path parameter
|
Path |
Path.before(Path path)
The element appears before the given path
|
Path |
BasicPath.beforeSibling(Path path)
The element is a sibling of the given path and appears before it
|
Path |
Path.beforeSibling(Path path)
The element is a sibling of the given path, and appears before it
|
Path |
BasicPath.childOf(Path path) |
Path |
Path.childOf(Path path)
The element is a direct child of the given path
|
org.openqa.selenium.WebElement |
InBrowser.clickAt(Path el)
Click at the location the first element that fits the given path.
|
org.openqa.selenium.WebElement |
InBrowser.clickOn(Path el)
Click on the first element that fits the given path.
|
Path |
BasicPath.containing(Path path) |
Path |
Path.containing(Path path)
The element contains the given path, i.e.
|
static ElementProperty |
ElementProperties.contains(Path... paths)
The given elements in the parameters list are contained in the current element
|
Path |
BasicPath.contains(Path path) |
Path |
Path.contains(Path path)
The element contains the given path, i.e.
|
Path |
BasicPath.descendantOf(Path path)
The element is inside the given path parameter
|
Path |
Path.descendantOf(Path path)
The element is contained in the given path element, i.e.
|
void |
InBrowser.doubleClickOn(Path el)
Doubleclick the location of the first element that fits the given path
|
org.openqa.selenium.WebElement |
Operations.ScrollElement.downUntilElementIsPresent(Path expectedElement)
Scroll down until the virtualized DOM contains the expect element.
|
org.openqa.selenium.WebElement |
Operations.ScrollElement.downUntilElementIsPresent(Path expectedElement,
int scrollStep,
int maxNumberOfScrolls)
Scroll down until the virtualized DOM contains the expect element.
|
Operations.DragAndDrop |
InBrowser.dragAndDrop(Path path)
Drag and drop in the browser.
|
org.openqa.selenium.WebElement |
InBrowser.find(Path el)
Finds an element in the browser, based on the xpath representing el.
|
List<org.openqa.selenium.WebElement> |
InBrowser.findAll(Path el)
Finds all elements in the browser, based on the xpath representing el.
|
static List<org.openqa.selenium.WebElement> |
InBrowserFinder.findAll(org.openqa.selenium.WebDriver driver,
Path el) |
static NodeList |
PathParsers.findAllByPath(Document doc,
Path path)
find all the nodes that match a path in a W3C document
|
static NodeList |
PathParsers.findAllByPath(String docString,
Path path)
find all the nodes that match a path in a W3C document
|
org.openqa.selenium.WebElement |
InBrowser.findPageWithNumberOfOccurrences(Path el,
int numberOfOccurrences,
RelationOperator relationOperator)
Don't use this directly.
|
static org.openqa.selenium.WebElement |
InBrowserFinder.findPageWithNumberOfOccurrences(org.openqa.selenium.WebDriver driver,
Path el,
int numberOfOccurrences) |
static org.openqa.selenium.WebElement |
InBrowserFinder.findPageWithNumberOfOccurrences(org.openqa.selenium.WebDriver driver,
Path el,
int numberOfOccurrences,
RelationOperator relationOperator) |
org.openqa.selenium.WebElement |
InBrowser.findPageWithout(Path el)
Finds an page in the browser, that does not contain the given path
|
static Path |
BasicPath.firstOccurrenceOf(Path path)
First global occurrence of an element in the document.
|
static ElementProperty |
ElementProperties.hasAncesctor(Path path)
Element is inside the given parameter
|
static ElementProperty |
ElementProperties.hasChild(Path... paths)
Element is the parent of the given list of elements
|
static ElementProperty |
ElementProperties.hasDescendant(Path... paths)
The given elements in the parameters list are contained in the current element
|
static ElementProperty |
ElementProperties.hasParent(Path path)
Element is direct child of the element matched by the given parameter
|
org.openqa.selenium.WebElement |
InBrowser.hoverOver(Path el)
Hover over the location of the first element that fits the given path
|
Path |
BasicPath.immediatelyAfterSibling(Path path)
The sibling right before the current element matches to the given Path parameter
|
Path |
Path.immediatelyAfterSibling(Path path)
The sibling right before the element matches the given path parameter
|
Path |
BasicPath.immediatelyBeforeSibling(Path path)
The sibling right after the element matches the given path parameter
|
Path |
Path.immediatelyBeforeSibling(Path path)
The sibling right after the element matches the given path parameter
|
Path |
BasicPath.inside(Path path)
Element that is inside another element
|
Path |
Path.inside(Path path)
Element that is inside another element
|
static ElementProperty |
ElementProperties.isAfter(Path... paths)
Element appears after all the given parameters in the document
|
static ElementProperty |
ElementProperties.isAfterSibling(Path... paths)
Element is a sibling of all the elements defined by the given paths, AND is after all those siblings
|
static ElementProperty |
ElementProperties.isAncestorOf(Path... paths)
The given elements in the parameters list are contained in the current element
|
static ElementProperty |
ElementProperties.isBefore(Path... paths)
Element is before all the elements given in the parameters
|
static ElementProperty |
ElementProperties.isBeforeSibling(Path... paths)
Element is a sibling of all the elements defined by the given paths, AND is before all those siblings
|
static ElementProperty |
ElementProperties.isChildOf(Path path)
Element is direct child of the element matched by the given parameter
|
static ElementProperty |
ElementProperties.isContainedIn(Path path) |
static ElementProperty |
ElementProperties.isDescendantOf(Path path)
Element is inside the given parameter
|
boolean |
InBrowser.isDisplayed(Path el)
is the element present and displayed? Typically you should not use this method directly.
|
boolean |
InBrowser.isEnabled(Path el)
is the element present and enabled? Typically you should not use this method directly.
|
static ElementProperty |
ElementProperties.isInside(Path path)
Element is inside the given parameter
|
boolean |
InBrowser.isNotPresent(Path el)
is the element present? Typically you should not use this method directly.
|
static ElementProperty |
ElementProperties.isParentOf(Path... paths)
Element is the parent of the given list of elements
|
boolean |
InBrowser.isPresent(Path el)
is the element present? Typically you should not use this method directly.
|
boolean |
InBrowser.isSelected(Path el)
is the element present and selected? Typically you should not use this method directly.
|
static ElementProperty |
ElementProperties.isSiblingOf(Path... paths)
Element is a sibling of all the elements defined by the given paths
|
static Path |
BasicPath.lastOccurrenceOf(Path path)
Last global occurrence of an element in the document
|
org.openqa.selenium.WebElement |
Operations.ScrollElement.leftUntilElementIsPresent(Path expectedElement)
Scroll left until the virtualized DOM contains the expect element.
|
org.openqa.selenium.WebElement |
Operations.ScrollElement.leftUntilElementIsPresent(Path expectedElement,
int scrollStep,
int maxNumberOfScrolls)
Scroll left until the virtualized DOM contains the expect element.
|
static Path |
PathOperators.not(Path path)
Any element that does NOT conform to the definition of the given path parameters
|
Integer |
InBrowser.numberOfAppearances(Path el)
Returns the number of elements in the browser that match the given path.
|
NPath |
NPath.NPathBuilder.occurrencesOf(Path path) |
Path |
BasicPath.GlobalOccurrenceNumber.of(Path path)
return the nth global occurrence (in the entire document) of the given path.
|
Path |
BasicPath.ChildNumber.ofType(Path path)
an element that has n similar preceding siblings.
|
void |
Operations.KeysDown.on(Path path)
Send key-down to an element in the browser
|
Path |
BasicPath.or(Path path)
match more than a single path.
|
Path |
Path.or(Path path)
match more than a single path.
|
Path |
BasicPath.parentOf(Path path) |
Path |
Path.parentOf(Path path)
The element is a parent of the given path
|
org.openqa.selenium.WebElement |
Operations.ScrollElement.rightUntilElementIsPresent(Path expectedElement)
Scroll right until the virtualized DOM contains the expect element.
|
org.openqa.selenium.WebElement |
Operations.ScrollElement.rightUntilElementIsPresent(Path expectedElement,
int scrollStep,
int maxNumberOfScrolls)
Scroll right until the virtualized DOM contains the expect element.
|
Operations.ScrollElement |
InBrowser.scrollElement(Path wrapper) |
org.openqa.selenium.WebElement |
InBrowser.scrollTo(Path el)
Scroll to the location of the first element that fits the given path
|
void |
Operations.KeysSender.to(Path path)
Send keys to a specific element in the browser
|
void |
Operations.Scroll.to(Path path)
Scroll until the location of an element
|
void |
Operations.DragAndDrop.to(Path target)
drag and drop to the given element's location
|
org.openqa.selenium.WebElement |
Operations.ScrollElement.upUntilElementIsPresent(Path expectedElement)
Scroll up until the virtualized DOM contains the expect element.
|
org.openqa.selenium.WebElement |
Operations.ScrollElement.upUntilElementIsPresent(Path expectedElement,
int scrollStep,
int maxNumberOfScrolls)
Scroll up until the virtualized DOM contains the expect element.
|
| Constructor and Description |
|---|
DragAndDrop(org.openqa.selenium.WebDriver driver,
Path path) |
NPath(Path path,
int n,
RelationOperator qualifier) |
ScrollElement(org.openqa.selenium.WebDriver driver,
Path wrapper) |
| Modifier and Type | Method and Description |
|---|---|
org.hamcrest.Matcher<Path> |
HasText.in(Document document) |
org.hamcrest.Matcher<Path> |
IsPresent.in(Document document) |
org.hamcrest.Matcher<Path> |
HasText.in(InBrowser browser) |
org.hamcrest.Matcher<Path> |
IsPresent.in(InBrowser browser) |
static org.hamcrest.Matcher<Path> |
CustomMatchers.isAbsentFrom(Document document)
Successful if given document has no elements that correspond to the given path.
|
static org.hamcrest.Matcher<Path> |
CustomMatchers.isAbsentFrom(InBrowser browser)
Successful if given browser has no elements that correspond to the given path.
|
static org.hamcrest.Matcher<Path> |
CustomMatchers.isDisplayedIn(InBrowser browser)
Successful if given element is present and displayed in the browser.
|
static org.hamcrest.Matcher<Path> |
CustomMatchers.isEnabledIn(InBrowser browser)
Successful if given element is present and enabled in the browser.
|
static org.hamcrest.Matcher<Path> |
CustomMatchers.isPresentIn(Document document)
Successful if given element is present in the document.
|
static org.hamcrest.Matcher<Path> |
CustomMatchers.isPresentIn(InBrowser browser)
Successful if given element is present in the browser.
|
static org.hamcrest.Matcher<Path> |
CustomMatchers.isSelectedIn(InBrowser browser)
Successful if given element is present and selected in the browser.
|
org.hamcrest.Matcher<Path> |
IsPresentNTimes.timesIn(Document doc) |
org.hamcrest.Matcher<Path> |
IsPresentNTimes.timesIn(InBrowser browser) |
org.hamcrest.Matcher<Path> |
IsPresentNTimes.timesOrLessIn(Document doc) |
org.hamcrest.Matcher<Path> |
IsPresentNTimes.timesOrLessIn(InBrowser browser) |
org.hamcrest.Matcher<Path> |
IsPresentNTimes.timesOrMoreIn(Document doc) |
org.hamcrest.Matcher<Path> |
IsPresentNTimes.timesOrMoreIn(InBrowser browser) |
| Modifier and Type | Method and Description |
|---|---|
static org.hamcrest.Matcher<InBrowser> |
CustomMatchers.hasElement(Path el)
Successful if the browser has an element that corresponds to the given path.
|
static HasElements |
CustomMatchers.hasElements(Path path)
Successful if element is present in the browser or a W3C document.
|
static org.hamcrest.Matcher<InBrowser> |
CustomMatchers.hasNoElement(Path el)
Successful if given browser has no elements that correspond to the given path.
|
static String |
CustomMatchersUtil.wrap(Path el) |
| Constructor and Description |
|---|
HasElementNTimes(Path path,
int nTimes) |
HasElements(Path path) |
| Modifier and Type | Class and Description |
|---|---|
class |
SingleBrowserPath
An implementation of
Path that is tailored to a singleton browser, thus allows some additional API's
for actions (for those who favor object-oriented API style) |
| Modifier and Type | Method and Description |
|---|---|
Path |
SingleBrowserPath.after(Path another) |
Path |
SingleBrowserPath.afterSibling(Path another) |
Path |
SingleBrowserPath.ancestorOf(Path another) |
Path |
SingleBrowserPath.and(ElementProperty... prop) |
Path |
SingleBrowserPath.before(Path another) |
Path |
SingleBrowserPath.beforeSibling(Path another) |
Path |
SingleBrowserPath.childOf(Path another) |
Path |
SingleBrowserPath.containing(Path another) |
Path |
SingleBrowserPath.contains(Path another) |
Path |
SingleBrowserPath.descendantOf(Path another) |
Path |
SingleBrowserPath.describedBy(String description) |
Path |
SingleBrowserPath.immediatelyAfterSibling(Path another) |
Path |
SingleBrowserPath.immediatelyBeforeSibling(Path another) |
Path |
SingleBrowserPath.inside(Path another) |
Path |
SingleBrowserPath.insideTopLevel() |
Path |
SingleBrowserPath.or(Path another) |
Path |
SingleBrowserPath.parentOf(Path another) |
Path |
SingleBrowserPath.that(ElementProperty... prop) |
Path |
SingleBrowserPath.withClass(String cssClass) |
Path |
SingleBrowserPath.withClasses(String... cssClasses) |
Path |
SingleBrowserPath.withGlobalIndex(Integer index) |
Path |
SingleBrowserPath.withText(String txt) |
Path |
SingleBrowserPath.withTextContaining(String txt) |
| Modifier and Type | Method and Description |
|---|---|
Path |
SingleBrowserPath.after(Path another) |
Path |
SingleBrowserPath.afterSibling(Path another) |
Path |
SingleBrowserPath.ancestorOf(Path another) |
Path |
SingleBrowserPath.before(Path another) |
Path |
SingleBrowserPath.beforeSibling(Path another) |
Path |
SingleBrowserPath.childOf(Path another) |
static org.openqa.selenium.WebElement |
InBrowserSinglton.clickAt(Path el)
Click on the location of the element that corresponds to the given path.
|
static org.openqa.selenium.WebElement |
InBrowserSinglton.clickOn(Path el)
Click on the element that corresponds to the given path.
|
Path |
SingleBrowserPath.containing(Path another) |
Path |
SingleBrowserPath.contains(Path another) |
Path |
SingleBrowserPath.descendantOf(Path another) |
static void |
InBrowserSinglton.doubleClickOn(Path el)
Doubleclick on the element that corresponds to the given path.
|
static Operations.DragAndDrop |
InBrowserSinglton.dragAndDrop(Path path)
Drag and drop in the browser.
|
static org.openqa.selenium.WebElement |
InBrowserSinglton.find(Path el)
Equivalent to WebDriver.findElement().
|
static List<org.openqa.selenium.WebElement> |
InBrowserSinglton.findAll(Path el)
Equivalent to WebDriver.findElements().
|
static org.openqa.selenium.WebElement |
InBrowserSinglton.hoverOver(Path el)
Hover over on the location of the element that corresponds to the given path.
|
Path |
SingleBrowserPath.immediatelyAfterSibling(Path another) |
Path |
SingleBrowserPath.immediatelyBeforeSibling(Path another) |
Path |
SingleBrowserPath.inside(Path another) |
static boolean |
InBrowserSinglton.isDisplayed(Path el)
Relies on Selenium WebElement::isDisplayed, thus non-atomic.
|
static boolean |
InBrowserSinglton.isEnabled(Path el)
Relies on Selenium WebElement::isEnabled, thus non-atomic.
|
static boolean |
InBrowserSinglton.isPresent(Path el) |
static boolean |
InBrowserSinglton.isSelected(Path el)
Relies on Selenium WebElement::isSelected, thus non-atomic.
|
static Integer |
InBrowserSinglton.numberOfAppearances(Path el)
Typically should not be used directly.
|
Path |
SingleBrowserPath.or(Path another) |
Path |
SingleBrowserPath.parentOf(Path another) |
static Operations.ScrollElement |
InBrowserSinglton.scrollElement(Path el)
scroll within the given element.
|
static org.openqa.selenium.WebElement |
InBrowserSinglton.scrollTo(Path el)
scroll to the location of the element that corresponds to the given path.
|
| Modifier and Type | Method and Description |
|---|---|
static org.hamcrest.Matcher<Path> |
CustomMatchers.hasText(String text)
Successful if element has the text equal to the given parameter in the browser/document.
|
static org.hamcrest.Matcher<Path> |
CustomMatchers.isAbsent()
Successful if the browser has no elements that correspond to the given path.
|
static org.hamcrest.Matcher<Path> |
CustomMatchers.isDisplayed()
Successful if given element is present and displayed in the browser.
|
static org.hamcrest.Matcher<Path> |
CustomMatchers.isEnabled()
Successful if given element is present and enabled in the browser.
|
static org.hamcrest.Matcher<Path> |
CustomMatchers.isNotDisplayed()
Successful if given element is present and displayed in the browser.
|
static org.hamcrest.Matcher<Path> |
CustomMatchers.isPresent()
Successful if the the element is present in the browser.
|
static org.hamcrest.Matcher<Path> |
CustomMatchers.isSelected()
Successful if given element is present and selected in the browser.
|
org.hamcrest.Matcher<Path> |
IsPresentNTimes.times() |
org.hamcrest.Matcher<Path> |
IsPresentNTimes.timesOrLess() |
org.hamcrest.Matcher<Path> |
IsPresentNTimes.timesOrMore() |
| Modifier and Type | Method and Description |
|---|---|
static Optional<org.jsoup.nodes.Element> |
DebugUtil.getDOM(Path el)
Same as
DebugUtil.getDOMOfAll(Path), but returns an optional of the first match. |
static List<org.jsoup.nodes.Element> |
DebugUtil.getDOMOfAll(Path el)
Get all matches of the path as a list of
Element. |
Copyright © 2018. All rights reserved.