interface Navigator extends Iterable<Navigator>, Locator, StringRepresentationProvider
Navigator is a jQuery-style DOM traversal tool that wraps a set of WebDriver WebElements. The code is based on the Doj library written by Kevin Wetzels: http://code.google.com/p/hue/
Fields inherited from class | Fields |
---|---|
interface Locator |
MATCH_ALL_SELECTOR |
Type Params | Return Type | Name and description |
---|---|---|
|
abstract Navigator |
add(String selector) |
|
abstract Navigator |
add(By bySelector) |
|
abstract Navigator |
add(WebElement[] elements) |
|
abstract Navigator |
add(Collection<WebElement> elements) |
|
abstract Collection<WebElement> |
allElements() |
|
abstract String |
attr(String name) Returns the value of the given attribute of the sole context element or null for empty Navigators. |
|
abstract Navigator |
children() Creates a new Navigator instance containing all the child elements of the current context elements. |
|
abstract Navigator |
children(String selector) Creates a new Navigator instance containing all the child elements of the current context elements that match the selector. |
|
abstract Navigator |
children(Map<String, Object> attributes) Creates a new Navigator instance containing all the child elements of the current context elements that match the given attributes. |
|
abstract Navigator |
children(Map<String, Object> attributes, String selector) Creates a new Navigator instance containing all the child elements of the current context elements that match the selector and given attributes. |
|
abstract List<String> |
classes() Returns an alphabetically sorted list of class names present on the sole context element or an empty list for empty Navigators. |
|
abstract Navigator |
click() Clicks on the sole context element. |
|
abstract Navigator |
click(Class<? extends Page> pageClass) Clicks on the sole context element, verifies the at checker (if it is defined) of the class passed as the argument and sets it as the current page. |
|
abstract Navigator |
click(Page pageInstance) Clicks on the sole context element, verifies the at checker (if it is defined) of the instance passed as the argument and sets it as the current page. |
|
abstract Navigator |
click(Class<? extends Page> pageClass, Wait wait) Clicks on the sole context element, verifies the at checker (if it is defined) of the instance passed as the argument and sets it as the current page. |
|
abstract Navigator |
click(Page pageInstance, Wait wait) Clicks on the sole context element, verifies the at checker (if it is defined) of the instance passed as the argument and sets it as the current page. |
|
abstract Navigator |
click(List potentialPages) Clicks on the sole context element, finds the first page from the list for which the at checker is defined and sets it as the current page. |
|
abstract Navigator |
click(List potentialPages, Wait wait) Clicks on the sole context element, finds the first page from the list for which the at checker is defined and sets it as the current page. |
|
abstract Navigator |
closest(String selector) Creates a new Navigator instance containing the first ancestor element of each of the current context elements that match the selector. |
|
abstract Navigator |
closest(Map<String, Object> attributes) Creates a new Navigator instance containing the first ancestor element of each of the current context elements that match the given attributes. |
|
abstract Navigator |
closest(Map<String, Object> attributes, String selector) Creates a new Navigator instance containing the first ancestor element of each of the current context elements that match the selector and given attributes. |
|
abstract String |
css(String propertyName) Gets the value of a given CSS property of the sole context element or null for empty Navigators. |
|
abstract Iterator<WebElement> |
elementIterator() |
|
abstract Navigator |
eq(int index) Gets the wrapped element at the given index. |
|
abstract Navigator |
filter(String selector) Filters the set of elements represented by this Navigator to include only those that match the selector. |
|
abstract Navigator |
filter(Map<String, Object> predicates) |
|
abstract Navigator |
filter(Map<String, Object> predicates, String selector) |
|
abstract Navigator |
findAll(Closure predicate) Overrides the standard Groovy findAll so that the object returned is a Navigator rather than a Collection |
|
abstract Navigator |
first() Creates a new Navigator instance containing only the first context element (wrapped). |
|
abstract WebElement |
firstElement() |
|
abstract Navigator |
getAt(int index) Gets the wrapped element at the given index. |
|
abstract Navigator |
getAt(Range range) Gets the wrapped elements in the given range. |
|
abstract Navigator |
getAt(Collection indexes) Gets the wrapped elements at the given indexes. |
|
abstract String |
getAttribute(String name) Returns the value of the given attribute of the sole context element or null for empty Navigators. |
|
abstract int |
getHeight() Returns the height of the sole element the navigator matches or 0 if it matches nothing. |
|
abstract JQueryAdapter |
getJquery() Returns an adapter for calling jQuery methods on the elements in this navigator. |
|
abstract String |
getStringRepresentation() Provides the text to be returned from toString() as well as to be used as part of the value returned from toString() if this navigator backs a template derived
content element. |
|
abstract int |
getWidth() Returns the width of the sole element the navigator matches or 0 if it matches nothing. |
|
abstract int |
getX() Returns the x coordinate (from the top left corner) of the sole element the navigator matches or 0 if it matches nothing. |
|
abstract int |
getY() Returns the y coordinate (from the top left corner) of the sole element the navigator matches or 0 if it matches nothing. |
|
abstract Navigator |
has(String selector) Filters the set of elements represented by this Navigator to include only that have one or more descendants that match the selector. |
|
abstract Navigator |
has(Map<String, Object> predicates, String selector) Filters the set of elements represented by this Navigator to include only that have one or more descendants that match the selector and attributes as defined in the predicate. |
|
abstract Navigator |
has(Map<String, Object> predicates) Filters the set of elements represented by this Navigator to include only that have one or more descendants that match the attributes as defined in the predicate. |
|
abstract Navigator |
has(By bySelector) Filters the set of elements represented by this Navigator to include only that have one or more descendants that match the bySelector. |
|
abstract Navigator |
has(Map<String, Object> predicates, By bySelector) Filters the set of elements represented by this Navigator to include only that have one or more descendants that match the bySelector and attributes as defined in the predicate. |
|
abstract boolean |
hasClass(String className) Returns true if the sole context element has the given class or false for empty Navigators. |
|
abstract Navigator |
hasNot(String selector) Filters the set of elements represented by this Navigator to exclude that have one or more descendants that match the selector. |
|
abstract Navigator |
hasNot(Map<String, Object> predicates, String selector) Filters the set of elements represented by this Navigator to exclude that have one or more descendants that match the selector and attributes as defined in the predicate. |
|
abstract Navigator |
hasNot(Map<String, Object> predicates) Filters the set of elements represented by this Navigator to exclude that have one or more descendants that match the attributes as defined in the predicate. |
|
abstract Navigator |
hasNot(By bySelector) Filters the set of elements represented by this Navigator to exclude that have one or more descendants that match the bySelector. |
|
abstract Navigator |
hasNot(Map<String, Object> predicates, By bySelector) Filters the set of elements represented by this Navigator to exclude that have one or more descendants that match the bySelector and attributes as defined in the predicate. |
|
abstract Navigator |
head() Creates a new Navigator instance containing only the first context element (wrapped). |
|
abstract boolean |
is(String tag) Returns true if the sole context element tag name matches the string passed as the argument or false for empty Navigators. |
|
abstract boolean |
isDisplayed() Returns true if the sole context element is displayed or false for empty Navigators. |
|
abstract boolean |
isEmpty() Returns true when there are no context elements. |
|
abstract boolean |
isFocused() Checks if the sole element of this navigator is focused by comparing it to the element returned from TargetLocator.activeElement.
|
|
abstract Iterator<Navigator> |
iterator() |
|
abstract Navigator |
last() Creates a new Navigator instance containing only the last context element (wrapped). |
|
abstract WebElement |
lastElement() |
|
abstract Navigator |
leftShift(Object value) |
<T extends Module> |
abstract T |
module(Class<T> moduleClass) Create and initialize an instance of the given module class, using this as its base. |
<T extends Module> |
abstract T |
module(T module) Initialize a module instance using this as its base. |
<T extends Module> |
abstract List<T> |
moduleList(Class<T> moduleClass) Create and initialize a list of module instances using navigators created from web elements which make up this navigator as their bases. |
<T extends Module> |
abstract List<T> |
moduleList(Closure<T> moduleFactory) Create a list of module instances using the provided factory and initialize them using navigators created from web elements which make up this navigator as their bases. |
|
abstract Navigator |
next() Creates a new Navigator instance containing the next sibling elements of the current context elements. |
|
abstract Navigator |
next(String selector) Creates a new Navigator instance containing the next sibling elements of the current context elements, matching the selector. |
|
abstract Navigator |
next(Map<String, Object> attributes) Creates a new Navigator instance containing the next sibling elements of the current context elements, matching the given attributes. |
|
abstract Navigator |
next(Map<String, Object> attributes, String selector) Creates a new Navigator instance containing the next sibling elements of the current context elements, matching the selector and given attributes. |
|
abstract Navigator |
nextAll() Creates a new Navigator instance containing all following sibling elements of the current context elements. |
|
abstract Navigator |
nextAll(String selector) Creates a new Navigator instance containing all following sibling elements of the current context elements that match the selector. |
|
abstract Navigator |
nextAll(Map<String, Object> attributes) Creates a new Navigator instance containing all following sibling elements of the current context elements, matching the given attributes. |
|
abstract Navigator |
nextAll(Map<String, Object> attributes, String selector) Creates a new Navigator instance containing all following sibling elements of the current context elements, matching the selector and given attributes. |
|
abstract Navigator |
nextUntil(String selector) Creates a new Navigator instance containing all following sibling elements of the current context elements up to, but not including, the first to match the selector. |
|
abstract Navigator |
nextUntil(Map<String, Object> attributes) Creates a new Navigator instance containing all following sibling elements of the current context elements up to, but not including, the first to match the given attributes. |
|
abstract Navigator |
nextUntil(Map<String, Object> attributes, String selector) Creates a new Navigator instance containing all following sibling elements of the current context elements up to, but not including, the first to match the selector and given attributes. |
|
abstract Navigator |
not(String selector) Returns a new Navigator instance containing all elements of the current Navigator that do not match the selector. |
|
abstract Navigator |
not(Map<String, Object> predicates, String selector) Returns a new Navigator instance containing all elements of the current Navigator that do not match the selector and attributes as defined in the predicate. |
|
abstract Navigator |
not(Map<String, Object> predicates) Returns a new Navigator instance containing all elements of the current Navigator that do not match the attributes as defined in the predicate. |
|
abstract Navigator |
parent() Creates a new Navigator instance containing the direct parent elements of the current context elements. |
|
abstract Navigator |
parent(String selector) Creates a new Navigator instance containing the direct parent elements of the current context elements that match the selector. |
|
abstract Navigator |
parent(Map<String, Object> attributes) Creates a new Navigator instance containing the direct parent elements of the current context elements that match the given attributes. |
|
abstract Navigator |
parent(Map<String, Object> attributes, String selector) Creates a new Navigator instance containing the direct parent elements of the current context elements that match the selector and given attributes. |
|
abstract Navigator |
parents() Creates a new Navigator instance containing all the ancestor elements of the current context elements. |
|
abstract Navigator |
parents(String selector) Creates a new Navigator instance containing all the ancestor elements of the current context elements that match the selector. |
|
abstract Navigator |
parents(Map<String, Object> attributes) Creates a new Navigator instance containing all the ancestor elements of the current context elements that match the given attributes. |
|
abstract Navigator |
parents(Map<String, Object> attributes, String selector) Creates a new Navigator instance containing all the ancestor elements of the current context elements that match the given attributes. |
|
abstract Navigator |
parentsUntil(String selector) Creates a new Navigator instance containing all the ancestor elements of the current context elements up to but not including the first that matches the selector. |
|
abstract Navigator |
parentsUntil(Map<String, Object> attributes) Creates a new Navigator instance containing all the ancestor elements of the current context elements up to but not including the first that matches the given attributes. |
|
abstract Navigator |
parentsUntil(Map<String, Object> attributes, String selector) Creates a new Navigator instance containing all the ancestor elements of the current context elements up to but not including the first that matches the selector and given attributes. |
|
abstract Navigator |
plus(Navigator navigator) Merges the Navigator instance with the current instance to create a new Navigator instance containing the context elements of both. |
|
abstract Navigator |
prevAll() Creates a new Navigator instance containing all preceding sibling elements of the current context elements. |
|
abstract Navigator |
prevAll(String selector) Creates a new Navigator instance containing all preceding sibling elements of the current context elements, matching the selector. |
|
abstract Navigator |
prevAll(Map<String, Object> attributes) Creates a new Navigator instance containing all preceding sibling elements of the current context elements, matching the given attributes. |
|
abstract Navigator |
prevAll(Map<String, Object> attributes, String selector) Creates a new Navigator instance containing all preceding sibling elements of the current context elements, matching the selector and given attributes. |
|
abstract Navigator |
prevUntil(String selector) Creates a new Navigator instance containing all preceding sibling elements of the current context elements up to, but not including the first matching the selector. |
|
abstract Navigator |
prevUntil(Map<String, Object> attributes) Creates a new Navigator instance containing all preceding sibling elements of the current context elements up to, but not including the first matching the given attributes. |
|
abstract Navigator |
prevUntil(Map<String, Object> attributes, String selector) Creates a new Navigator instance containing all preceding sibling elements of the current context elements up to, but not including the first matching the selector and given attributes. |
|
abstract Navigator |
previous() Creates a new Navigator instance containing the previous sibling elements of the current context elements. |
|
abstract Navigator |
previous(String selector) Creates a new Navigator instance containing the previous sibling elements of the current context elements, matching the selector. |
|
abstract Navigator |
previous(Map<String, Object> attributes) Creates a new Navigator instance containing the previous sibling elements of the current context elements, matching the given attributes. |
|
abstract Navigator |
previous(Map<String, Object> attributes, String selector) Creates a new Navigator instance containing the previous sibling elements of the current context elements, matching the selector and given attributes. |
|
abstract Navigator |
remove(int index) Creates a new Navigator instance by removing the element at the given index from the context. |
|
abstract void |
setEventListener(NavigatorEventListener listener) |
|
abstract Navigator |
siblings() Creates a new Navigator instance containing all the sibling elements of the current context elements. |
|
abstract Navigator |
siblings(String selector) Creates a new Navigator instance containing all the sibling elements of the current context elements that match the selector. |
|
abstract Navigator |
siblings(Map<String, Object> attributes) Creates a new Navigator instance containing all the sibling elements of the current context elements that match the given attributes. |
|
abstract Navigator |
siblings(Map<String, Object> attributes, String selector) Creates a new Navigator instance containing all the sibling elements of the current context elements that match the selector and given attributes. |
|
abstract WebElement |
singleElement() |
|
abstract int |
size() Returns the number of context elements. |
|
abstract String |
tag() Returns the tag name of the sole context element or null for empty Navigators. |
|
abstract Navigator |
tail() Creates a new Navigator instance containing all but the first context element (wrapped). |
|
abstract String |
text() Returns the visible (i.e. not hidden by CSS) inner text content of the sole context element and its sub-elements or null for empty Navigators. |
|
abstract Navigator |
unique() Creates a new Navigator instance containing all elements of this instance with duplicate elements removed |
|
abstract Object |
value() Returns the value of the sole context element for input elements (including textarea, select and button) or null for empty Navigators. |
|
abstract Navigator |
value(Object value) Sets the value of the form input elements to the given value. |
|
abstract Navigator |
verifyNotEmpty() Throws an exception when the Navigator instance is empty. |
Returns the value of the given attribute of the sole context element or null for empty Navigators. Cannot be called on multi element Navigators.
name
- name of the attributeCreates a new Navigator instance containing all the child elements of the current context elements.
Creates a new Navigator instance containing all the child elements of the current context elements that match the selector.
selector
- to matchCreates a new Navigator instance containing all the child elements of the current context elements that match the given attributes.
attributes
- to matchCreates a new Navigator instance containing all the child elements of the current context elements that match the selector and given attributes.
attributes
- to matchselector
- to matchReturns an alphabetically sorted list of class names present on the sole context element or an empty list for empty Navigators. Cannot be called on multi element Navigators.
Clicks on the sole context element. Cannot be called on multi element Navigators.
Clicks on the sole context element, verifies the at checker (if it is defined) of the class passed as the argument and sets it as the current page. Cannot be called on multi element Navigators.
pageClass
- page class to be used as the new current page after clicking the elementClicks on the sole context element, verifies the at checker (if it is defined) of the instance passed as the argument and sets it as the current page. Cannot be called on multi element Navigators.
pageInstance
- page instance to be used as the new current page after clicking the elementClicks on the sole context element, verifies the at checker (if it is defined) of the instance passed as the argument and sets it as the current page. Cannot be called on multi element Navigators.
pageClass
- page class to be used as the new current page after clicking the elementwait
- configuration to be used for waiting for the at checker to succeedClicks on the sole context element, verifies the at checker (if it is defined) of the instance passed as the argument and sets it as the current page. Cannot be called on multi element Navigators.
pageInstance
- page instance to be used as the new current page after clicking the elementwait
- configuration to be used for waiting for the at checker to succeedClicks on the sole context element, finds the first page from the list for which the at checker is defined and sets it as the current page. Cannot be called on multi element Navigators.
potentialPages
- a list of classes extending Page or a list of instances of such classesClicks on the sole context element, finds the first page from the list for which the at checker is defined and sets it as the current page. Cannot be called on multi element Navigators.
potentialPages
- a list of classes extending Page or a list of instances of such classeswait
- configuration to be used for waiting for the at checkers to succeedCreates a new Navigator instance containing the first ancestor element of each of the current context elements that match the selector.
Unlike parent(), this method will keep traversing up the DOM until a match is found or the top of the DOM has been found
selector
- to matchCreates a new Navigator instance containing the first ancestor element of each of the current context elements that match the given attributes.
Unlike parent(), this method will keep traversing up the DOM until a match is found or the top of the DOM has been found
attributes
- to matchCreates a new Navigator instance containing the first ancestor element of each of the current context elements that match the selector and given attributes.
Unlike parent(), this method will keep traversing up the DOM until a match is found or the top of the DOM has been found
selector
- to matchattributes
- to matchGets the value of a given CSS property of the sole context element or null for empty Navigators. Cannot be called on multi element Navigators.
Color values should be returned as rgba strings, so, for example if the "background-color" property is set as "green" in the HTML source, the returned value will be "rgba(0, 255, 0, 1)". Note that shorthand CSS properties (e.g. background, font, border, border-top, margin, margin-top, padding, padding-top, list-style, outline, pause, cue) are not returned, in accordance with the DOM CSS2 specification - you should directly access the longhand properties (e.g. background-color) to access the desired values.
Gets the wrapped element at the given index.
When no such element exists, an empty Navigator instance is returned.
index
- index of the element to retrieve - pass a negative value to start from the backFilters the set of elements represented by this Navigator to include only those that match the selector.
selector
- a CSS selector Overrides the standard Groovy findAll so that the object returned is a Navigator rather than a Collection
Creates a new Navigator instance containing only the first context element (wrapped).
Gets the wrapped element at the given index.
When no such element exists, an empty Navigator instance is returned.
index
- index of the element to retrieve - pass a negative value to start from the backGets the wrapped elements in the given range.
When no such elements exist, an empty Navigator instance is returned.
range
- range of the elements to retrieveGets the wrapped elements at the given indexes.
When no such elements exist, an empty Navigator instance is returned.
indexes
- indexes of the elements to retrieveReturns the value of the given attribute of the sole context element or null for empty Navigators. Cannot be called on multi element Navigators.
name
- name of the attributeReturns the height of the sole element the navigator matches or 0 if it matches nothing. Cannot be called on multi element Navigators.
To get the height of all matched elements you can use the spread operator navigator*.height
Returns an adapter for calling jQuery methods on the elements in this navigator.
Provides the text to be returned from toString()
as well as to be used as part of the value returned from toString()
if this navigator backs a template derived
content element.
Returns the width of the sole element the navigator matches or 0 if it matches nothing. Cannot be called on multi element Navigators.
To get the width of all matched elements you can use the spread operator navigator*.width
Returns the x coordinate (from the top left corner) of the sole element the navigator matches or 0 if it matches nothing. Cannot be called on multi element Navigators.
To get the x coordinate of all matched elements you can use the spread operator navigator*.x
Returns the y coordinate (from the top left corner) of the sole element the navigator matches or 0 if it matches nothing. Cannot be called on multi element Navigators.
To get the y coordinate of all matched elements you can use the spread operator navigator*.y
Filters the set of elements represented by this Navigator to include only that have one or more descendants that match the selector.
selector
- a CSS selectorFilters the set of elements represented by this Navigator to include only that have one or more descendants that match the selector and attributes as defined in the predicate.
selector
- a CSS selectorpredicates
- a Map with keys representing attributes and values representing required values or patternsFilters the set of elements represented by this Navigator to include only that have one or more descendants that match the attributes as defined in the predicate.
predicates
- a Map with keys representing attributes and values representing required values or patternsFilters the set of elements represented by this Navigator to include only that have one or more descendants that match the bySelector.
bySelector
- a WebDriver By selectorFilters the set of elements represented by this Navigator to include only that have one or more descendants that match the bySelector and attributes as defined in the predicate.
bySelector
- a WebDriver By selectorpredicates
- a Map with keys representing attributes and values representing required values or patternsReturns true if the sole context element has the given class or false for empty Navigators. Cannot be called on multi element Navigators.
className
- class to check forFilters the set of elements represented by this Navigator to exclude that have one or more descendants that match the selector.
selector
- a CSS selectorFilters the set of elements represented by this Navigator to exclude that have one or more descendants that match the selector and attributes as defined in the predicate.
selector
- a CSS selectorpredicates
- a Map with keys representing attributes and values representing excluded values or patternsFilters the set of elements represented by this Navigator to exclude that have one or more descendants that match the attributes as defined in the predicate.
predicates
- a Map with keys representing attributes and values representing excluded values or patternsFilters the set of elements represented by this Navigator to exclude that have one or more descendants that match the bySelector.
bySelector
- a WebDriver By selectorFilters the set of elements represented by this Navigator to exclude that have one or more descendants that match the bySelector and attributes as defined in the predicate.
bySelector
- a WebDriver By selectorpredicates
- a Map with keys representing attributes and values representing required values or patternsCreates a new Navigator instance containing only the first context element (wrapped).
Returns true if the sole context element tag name matches the string passed as the argument or false for empty Navigators. Cannot be called on multi element Navigators.
tag
- tag name to matchReturns true if the sole context element is displayed or false for empty Navigators. Cannot be called on multi element Navigators.
Returns true when there are no context elements.
Checks if the sole element of this
navigator is focused by comparing it to the element returned from TargetLocator.activeElement.
If the navigator is empty false
will be returned. Cannot be called on multi element Navigators.
true
if the first element is focusedCreates a new Navigator instance containing only the last context element (wrapped).
Create and initialize an instance of the given module class, using this
as its base.
moduleClass
- a class extending Module Initialize a module instance using this
as its base.
module
- an instance of a class extending Module Create and initialize a list of module instances using navigators created from web elements which make up this
navigator as their bases.
moduleClass
- a class extending Module Create a list of module instances using the provided factory and initialize them using navigators created from web elements which make up this
navigator as their bases.
moduleFactory
- a closure that should return a new module instance every time it's calledCreates a new Navigator instance containing the next sibling elements of the current context elements.
Creates a new Navigator instance containing the next sibling elements of the current context elements, matching the selector.
Unlike next(), this method will keep looking for the first matching sibling until it finds a match or is out of siblings.
selector
- to matchCreates a new Navigator instance containing the next sibling elements of the current context elements, matching the given attributes.
Unlike next(), this method will keep looking for the first matching sibling until it finds a match or is out of siblings.
attributes
- to matchCreates a new Navigator instance containing the next sibling elements of the current context elements, matching the selector and given attributes.
Unlike next(), this method will keep looking for the first matching sibling until it finds a match or is out of siblings.
attributes
- to matchselector
- to matchCreates a new Navigator instance containing all following sibling elements of the current context elements.
Creates a new Navigator instance containing all following sibling elements of the current context elements that match the selector.
Unlike next(), this method will keep looking for the first matching sibling until it finds a match or is out of siblings.
selector
- to matchCreates a new Navigator instance containing all following sibling elements of the current context elements, matching the given attributes.
Unlike next(), this method will keep looking for the first matching sibling until it finds a match or is out of siblings.
attributes
- to matchCreates a new Navigator instance containing all following sibling elements of the current context elements, matching the selector and given attributes.
Unlike next(), this method will keep looking for the first matching sibling until it finds a match or is out of siblings.
attributes
- to matchselector
- to matchCreates a new Navigator instance containing all following sibling elements of the current context elements up to, but not including, the first to match the selector.
selector
- to matchCreates a new Navigator instance containing all following sibling elements of the current context elements up to, but not including, the first to match the given attributes.
attributes
- to matchCreates a new Navigator instance containing all following sibling elements of the current context elements up to, but not including, the first to match the selector and given attributes.
attributes
- to matchselector
- to matchReturns a new Navigator instance containing all elements of the current Navigator that do not match the selector.
selector
- a CSS selectorReturns a new Navigator instance containing all elements of the current Navigator that do not match the selector and attributes as defined in the predicate.
predicates
- a Map with keys representing attributes and values representing required values or patternsselector
- a CSS selectorReturns a new Navigator instance containing all elements of the current Navigator that do not match the attributes as defined in the predicate.
predicates
- a Map with keys representing attributes and values representing required values or patternsCreates a new Navigator instance containing the direct parent elements of the current context elements.
Creates a new Navigator instance containing the direct parent elements of the current context elements that match the selector.
selector
- to matchCreates a new Navigator instance containing the direct parent elements of the current context elements that match the given attributes.
attributes
- to matchCreates a new Navigator instance containing the direct parent elements of the current context elements that match the selector and given attributes.
attributes
- to matchselector
- to matchCreates a new Navigator instance containing all the ancestor elements of the current context elements.
Creates a new Navigator instance containing all the ancestor elements of the current context elements that match the selector.
selector
- to matchCreates a new Navigator instance containing all the ancestor elements of the current context elements that match the given attributes.
attributes
- to matchCreates a new Navigator instance containing all the ancestor elements of the current context elements that match the given attributes.
attributes
- to matchselector
- to matchCreates a new Navigator instance containing all the ancestor elements of the current context elements up to but not including the first that matches the selector.
selector
- to matchCreates a new Navigator instance containing all the ancestor elements of the current context elements up to but not including the first that matches the given attributes.
attributes
- to matchCreates a new Navigator instance containing all the ancestor elements of the current context elements up to but not including the first that matches the selector and given attributes.
attributes
- to matchselector
- to matchMerges the Navigator instance with the current instance to create a new Navigator instance containing the context elements of both.
navigator
- navigator to merge with this oneCreates a new Navigator instance containing all preceding sibling elements of the current context elements.
Creates a new Navigator instance containing all preceding sibling elements of the current context elements, matching the selector.
selector
- to matchCreates a new Navigator instance containing all preceding sibling elements of the current context elements, matching the given attributes.
attributes
- to matchCreates a new Navigator instance containing all preceding sibling elements of the current context elements, matching the selector and given attributes.
selector
- to matchattributes
- to matchCreates a new Navigator instance containing all preceding sibling elements of the current context elements up to, but not including the first matching the selector.
selector
- to matchCreates a new Navigator instance containing all preceding sibling elements of the current context elements up to, but not including the first matching the given attributes.
attributes
- to matchCreates a new Navigator instance containing all preceding sibling elements of the current context elements up to, but not including the first matching the selector and given attributes.
attributes
- to matchselector
- to matchCreates a new Navigator instance containing the previous sibling elements of the current context elements.
Creates a new Navigator instance containing the previous sibling elements of the current context elements, matching the selector.
Unlike previous(), this method will keep looking for the first matching sibling until it finds a match or is out of siblings.
selector
- to matchCreates a new Navigator instance containing the previous sibling elements of the current context elements, matching the given attributes.
Unlike previous(), this method will keep looking for the first matching sibling until it finds a match or is out of siblings.
attributes
- to matchCreates a new Navigator instance containing the previous sibling elements of the current context elements, matching the selector and given attributes.
Unlike previous(), this method will keep looking for the first matching sibling until it finds a match or is out of siblings.
attributes
- to matchselector
- to matchCreates a new Navigator instance by removing the element at the given index from the context.
If no such element exists, the current instance is returned.
index
- index of the element to remove - pass a negative value to start from the backCreates a new Navigator instance containing all the sibling elements of the current context elements.
Creates a new Navigator instance containing all the sibling elements of the current context elements that match the selector.
selector
- to matchCreates a new Navigator instance containing all the sibling elements of the current context elements that match the given attributes.
attributes
- to matchCreates a new Navigator instance containing all the sibling elements of the current context elements that match the selector and given attributes.
attributes
- to matchselector
- to matchReturns the number of context elements.
Returns the tag name of the sole context element or null for empty Navigators. Cannot be called on multi element Navigators.
Creates a new Navigator instance containing all but the first context element (wrapped).
Returns the visible (i.e. not hidden by CSS) inner text content of the sole context element and its sub-elements or null for empty Navigators. Cannot be called on multi element Navigators.
Creates a new Navigator instance containing all elements of this instance with duplicate elements removed
Returns the value of the sole context element for input elements (including textarea, select and button) or null for empty Navigators. Cannot be called on multi element Navigators.
In the case of a select, the value of the selected option or a list of selected options is returned.
Sets the value of the form input elements to the given value.
value
- value to useThrows an exception when the Navigator instance is empty.
Groovy API Documentation for Geb 5.1 - Licensed under the Apache License, Version 2.0 - http://www.gebish.org