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 |
---|---|---|
|
Navigator |
add(String selector) |
|
Navigator |
add(By bySelector) |
|
Navigator |
add(WebElement[] elements) |
|
Navigator |
add(Collection<WebElement> elements) |
|
Collection<WebElement> |
allElements() Returns all context elements. |
|
String |
attr(String name) Returns the value of the given attribute of the sole context element or null for empty Navigators. |
|
Navigator |
children() Creates a new Navigator instance containing all the child elements of the current context elements. |
|
Navigator |
children(String selector) Creates a new Navigator instance containing all the child elements of the current context elements that match the selector. |
|
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. |
|
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. |
|
List<String> |
classes() Returns an alphabetically sorted list of class names present on the sole context element or an empty list for empty Navigators. |
|
Navigator |
click() Clicks on the sole context element. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
String |
css(String propertyName) Gets the value of a given CSS property of the sole context element or null for empty Navigators. |
|
Iterator<WebElement> |
elementIterator() |
|
Navigator |
eq(int index) Gets the wrapped element at the given index. |
|
Navigator |
filter(String selector) Filters the set of elements represented by this Navigator to include only those that match the selector. |
|
Navigator |
filter(Map<String, Object> predicates) |
|
Navigator |
filter(Map<String, Object> predicates, String selector) |
|
Navigator |
findAll(Closure predicate) Overrides the standard Groovy findAll so that the object returned is a Navigator rather than a Collection |
|
Navigator |
first() Creates a new Navigator instance containing only the first context element (wrapped). |
|
WebElement |
firstElement() Returns the first context element (not wrapped). |
|
Navigator |
getAt(int index) Gets the wrapped element at the given index. |
|
Navigator |
getAt(Range range) Gets the wrapped elements in the given range. |
|
Navigator |
getAt(Collection indexes) Gets the wrapped elements at the given indexes. |
|
String |
getAttribute(String name) Returns the value of the given attribute of the sole context element or null for empty Navigators. |
|
int |
getHeight() Returns the height of the sole element the navigator matches or 0 if it matches nothing. |
|
JQueryAdapter |
getJquery() Returns an adapter for calling jQuery methods on the elements in this navigator. |
|
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. |
|
int |
getWidth() Returns the width of the sole element the navigator matches or 0 if it matches nothing. |
|
int |
getX() Returns the x coordinate (from the top left corner) of the sole element the navigator matches or 0 if it matches nothing. |
|
int |
getY() Returns the y coordinate (from the top left corner) of the sole element the navigator matches or 0 if it matches nothing. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
boolean |
hasClass(String className) Returns true if the sole context element has the given class or false for empty Navigators. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
Navigator |
head() Creates a new Navigator instance containing only the first context element (wrapped). |
|
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. |
|
boolean |
isDisplayed() Returns true if the sole context element is displayed or false for empty Navigators. |
|
boolean |
isEmpty() Returns true when there are no context elements. |
|
boolean |
isFocused() Checks if the sole element of this navigator is focused by comparing it to the element returned from TargetLocator.activeElement.
|
|
Iterator<Navigator> |
iterator() |
|
Navigator |
last() Creates a new Navigator instance containing only the last context element (wrapped). |
|
WebElement |
lastElement() Returns the last context element (not wrapped). |
|
Navigator |
leftShift(def value) |
<T extends Module> |
T |
module(Class<T> moduleClass) Create and initialize an instance of the given module class, using this as its base. |
<T extends Module> |
T |
module(T module) Initialize a module instance using this as its base. |
<T extends Module> |
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> |
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. |
|
Navigator |
next() Creates a new Navigator instance containing the next sibling elements of the current context elements. |
|
Navigator |
next(String selector) Creates a new Navigator instance containing the next sibling elements of the current context elements, matching the selector. |
|
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. |
|
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. |
|
Navigator |
nextAll() Creates a new Navigator instance containing all following sibling elements of the current context elements. |
|
Navigator |
nextAll(String selector) Creates a new Navigator instance containing all following sibling elements of the current context elements that match the selector. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
Navigator |
not(String selector) Returns a new Navigator instance containing all elements of the current Navigator that do not match the selector. |
|
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. |
|
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. |
|
Navigator |
parent() Creates a new Navigator instance containing the direct parent elements of the current context elements. |
|
Navigator |
parent(String selector) Creates a new Navigator instance containing the direct parent elements of the current context elements that match the selector. |
|
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. |
|
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. |
|
Navigator |
parents() Creates a new Navigator instance containing all the ancestor elements of the current context elements. |
|
Navigator |
parents(String selector) Creates a new Navigator instance containing all the ancestor elements of the current context elements that match the selector. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
Navigator |
plus(Navigator navigator) Merges the Navigator instance with the current instance to create a new Navigator instance containing the context elements of both. |
|
Navigator |
prevAll() Creates a new Navigator instance containing all preceding sibling elements of the current context elements. |
|
Navigator |
prevAll(String selector) Creates a new Navigator instance containing all preceding sibling elements of the current context elements, matching the selector. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
Navigator |
previous() Creates a new Navigator instance containing the previous sibling elements of the current context elements. |
|
Navigator |
previous(String selector) Creates a new Navigator instance containing the previous sibling elements of the current context elements, matching the selector. |
|
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. |
|
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. |
|
Navigator |
remove(int index) Creates a new Navigator instance by removing the element at the given index from the context. |
|
Navigator |
siblings() Creates a new Navigator instance containing all the sibling elements of the current context elements. |
|
Navigator |
siblings(String selector) Creates a new Navigator instance containing all the sibling elements of the current context elements that match the selector. |
|
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. |
|
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. |
|
WebElement |
singleElement() Returns the sole context element (not wrapped). |
|
int |
size() Returns the number of context elements. |
|
String |
tag() Returns the tag name of the sole context element or null for empty Navigators. |
|
Navigator |
tail() Creates a new Navigator instance containing all but the first context element (wrapped). |
|
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. |
|
Navigator |
unique() Creates a new Navigator instance containing all elements of this instance with duplicate elements removed |
|
def |
value() Returns the value of the sole context element for input elements (including textarea, select and button) or null for empty Navigators. |
|
Navigator |
value(def value) Sets the value of the form input elements to the given value. |
|
Navigator |
verifyNotEmpty() Throws an exception when the Navigator instance is empty. |
Returns all context elements.
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).
Returns the first context element (not 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).
Returns the last context element (not 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 sole context element (not wrapped). Cannot be called on multi element Navigators.
Returns 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 3.0 - Licensed under the Apache License, Version 2.0 - http://www.gebish.org