ValuePageElementList extends PageElementList with the possibility to set, retrieve and check the values of ValuePageElements managed by ValuePageElementList.
It also adds another initial waiting condition:
an XPath expression which identifies all ValuePageElements managed by ValuePageElementList
the options used to configure ValuePageElementList
_$
provides access to the PageNode retrieval functions of PageElementList's PageNodeStore and prefixes the
selectors of all PageNodes retrieved via _$
with the selector of PageElementList.
By default, the results of an "identification process" (the last invocation of PageElementList's identify
function) are cached for future invocations of PageElementList's identify
function.
If _disableCache
is set to true, this caching of identification results will be disabled and a new
"identification process" will be performed on each invocation of PageElementList's identify
function.
Disabling the identification results cache can be useful if the contents of a PageElementList change often.
If the contents of a PageElementList rarely change, PageElementList's identify
function can be invoked with the
resetCache
option set to true in order to repeat the "identification process" for a changed page content.
the options passed to _elementStoreFunc
to configure a managed PageElement instance
This function retrieves an instance of a PageElement mapped by PageElementList from the list's PageNodeStore.
caches the last result of PageElementList's identify
function for future invocations of the function
This is the default identifier
used to identify a PageElementList's managed PageElements via the key names
defined in identifier
's mappingObject
by matching mappingObject
's values with the return values of
identifier's mappingFunc
.
This default identifier
can be overwritten by passing a custom identifier
in the function parameters of
PageElementList's identify
function.
the default interval used by PageElementList for all of its functions that operate with intervals
(eg. wait
and eventually
)
Stores the last differences of PageNode's check state functions.
Intended for framework-internal usage only.
the XPath selector of PageNode
an instance of PageNodeStore which can be used to retrieve/create PageNodes
the default timeout used by PageElementList for all of its functions that operate with timeouts
(eg. wait
and eventually
)
Stores an instance of ListWhereBuilder which allows to select subsets of the PageElements managed by PageElementList by modifying the list's selector using XPath modification functions.
an XPath expression which identifies all PageElements managed by PageElementList
$
provides access to the PageNode retrieval functions of PageElementList's PageNodeStore and prefixes the
selectors of all PageNodes retrieved via $
with the selector of PageElementList.
Retrieves all PageElements found in the DOM that are identified by PageElementList's XPath selector.
Fetches all webdriverio elements identified by PageElementList's XPath selector from the HTML page.
Retrieves the first PageElement found in the DOM that is identified by PageElementList's XPath selector.
The .where
accessor allows to select and retrieve subsets of the PageElements managed by PageElementList by
constraining the list's selector using XPath modification functions.
Provides custom error handling of 'could not be located' and 'WaitUntilTimeoutError' errors for functions that check if a condition returns true within a specific timeout.
the function which is supposed to return true within a specific timeout
Executes func and trows any errors that occur during its execution.
If an error occurs because an element could not be located on the page, throws a custom 'could not be located' error message.
the function to be executed
the result value of the executed function
Provides custom error handling of 'could not be located' and 'WaitUntilTimeoutError' errors for functions that wait for a condition to become true within a specific timeout and throw an error if the condition does not become true.
the function which is supposed to return true within a specific timeout and throws an error if the condition does not become true
an errorMessage that describes the condition which did not become true within a specific timeout
the timeout used to wait for the result of the passed func to return true
this (an instance of PageNode)
This function executes a waitFunc until it returns true or a specific timeout is reached. If the return value of waitFunc does not become true within the timeout, this function throws a 'WaitUntilTimeoutError'.
__waitUntil also provides custom error handling for 'could not be located' errors.
the function which is supposed to return true within a specific timeout
a function that returns an errorMessage which describes the condition that did not become true within a specific timeout
the timeout used to wait for the result of the waitFunc to return true
the interval used to check for the result of the waitFunc to return true
this (an instance of PageNode)
This function implements custom error handling for 'could not be located' and 'WaitUntilTimeoutError' errors.
an arbitrary type of error
used to describe the failed condition check which caused a WaitUntilTimeoutError
the timeout used to wait for an element to be located or for a wait condition to return true
Used to determine if a function of a managed PageElement should be invoked or if its invocation should be skipped because the PageElement is not included by a filterMask.
a filterMask entry that refers to a corresponding managed PageElement
Retrieves the PageElement found in the DOM at the defined index of occurrence that is identified by PageElementList's XPath selector.
the index of occurrence in the DOM of the retrieved PageElement - STARTS AT 0
Invokes a state check function for each PageElement in a passed elements
array and returns true if the result of
each state check function invocation was true.
If the passed elements
array was empty, this function will always return true.
an array containing all PageElements for which checkFunc
should be executed
a state check function executed for each PageElement in elements
. It is passed a PageElement as
first parameter and an expected value used by the state check comparison as an optional second parameter.
a single expected value or an array of expected values used for the state check comparisons
If expected
is a single value, this value is compared to each element in the array of actual values.
If expected
is an array of values, its length must match the length of elements
and the values of its
array elements are compared to the array of actual values.
if set to true, the expected
parameter represents a filterMask which can be used to skip the
invocation of the state check function for some or all PageElements
true if the state check functions of all checked PageElements returned true or if no state check functions were invoked at all
Invokes a state check function for each PageElement in a passed elements
array and returns an array of state
check function results.
an array containing all PageElements for which checkFunc
should be executed
a state check function executed for each PageElement in elements
. It is passed a PageElement as
first parameter and an expected value used by the state check comparison as an optional second parameter.
a single expected value or an array of expected values used for the state check comparisons
If expected
is a single value, this value is compared to each element in the array of actual values.
If expected
is an array of values, its length must match the length of elements
and the values of its
array elements are compared to the array of actual values.
if set to true, the expected
parameter represents a filterMask which can be used to skip the
invocation of the state check function for some or all PageElements.
The results of skipped function invocations are not included in the total results array.
an array of results of a state check function executed for each PageElement of elements
Executes an action for each of PageElementList's managed PageElements.
an action executed for each of PageElementList's managed PageElements
can be used to skip the execution of an action for some or all PageElements
this (an instance of PageElementList)
Invokes a state retrieval function for each PageElement in a passed elements
array and returns an array of state
retrieval function results.
an array containing all PageElements for which getFunc
should be executed
a state retrieval function executed for each PageElement in elements
. It is passed a PageElement
as first parameter.
can be used to skip the invocation of the state retrieval function for some or all PageElements. The results of skipped function invocations are not included in the total results array.
an array of results of a state retrieval function executed for each PageElement of elements
Invokes a setter function for each PageElement in a passed elements
array.
an array containing all PageElements for which setFunc
should be executed
a setter function executed for each PageElement in elements
. It is passed a PageElement as
first parameter and the value to be set as second parameter.
a single setter value or an array of setter values
If values
is a single value, all PageElements in the elements
array are set to this value.
If values
is an array of values, its length must match the length of elements
and all PageElements
in the elements
array are set to the values of the values
array in the order that the PageElements were
retrieved from the DOM.
this (an instance of PageElementList)
Invokes a wait function for each PageElement in a passed elements
array.
Throws an error if the wait condition of an invoked wait function was not met within a specific timeout.
an array containing all PageElements for which waitFunc
should be executed
a wait function executed for each PageElement in elements
. It is passed a PageElement as
first parameter and an expected value used by the wait condition as an optional second parameter.
a single expected value or an array of expected values used for the wait conditions
If expected
is a single value, this value is compared to each element in the array of actual values.
If expected
is an array of values, its length must match the length of elements
and the values of its
array elements are compared to the array of actual values.
if set to true, the expected
parameter represents a filterMask which can be used to skip the
invocation of the wait function for some or all PageElements
this (an instance of PageElementList)
Returns the 'containsDirectText' status of all PageElements managed by PageElementList as an array after performing the initial waiting condition of each managed PageElement.
A PageElement's 'containsDirectText' status is set to true if its actual direct text contains the expected direct text.
A direct text is a text that resides on the level directly below the selected HTML element. It does not include any text of the HTML element's nested children HTML elements.
the expected direct text used in the comparisons which set the 'containsDirectText' status.
If directText
is a single value, this value is compared to each element in the array of actual values of all
PageElements.
If directText
is an array of values, its length must match the length of PageElementList and the values of its
array elements are compared to the array of actual values of all PageElements.
Returns the 'containsText' status of all PageElements managed by PageElementList as an array after performing the initial waiting condition of each managed PageElement.
A PageElement's 'containsText' status is set to true if its actual text contains the expected text.
the expected text used in the comparisons which set the 'containsText' status.
If text
is a single value, this value is compared to each element in the array of actual values of all
PageElements.
If text
is an array of values, its length must match the length of PageElementList and the values of its array
elements are compared to the array of actual values of all PageElements.
Returns the 'containsValue' status of all ValuePageElements managed by ValuePageElementList as an array after performing the initial waiting condition of ValuePageElementList and each managed ValuePageElement.
A ValuePageElement's 'containsValue' status is set to true if its actual value contains the expected value.
the expected value used in the comparisons which set the 'containsValue' status.
If value
is a single value, this value is compared to each element in the array of actual values of all
ValuePageElements.
If value
is an array of values, its length must match the length of ValuePageElementList and the values of its
array elements are compared to the array of actual values of all ValuePageElements.
Returns the direct texts of all PageElements managed by PageElementList as an array after performing the initial waiting condition of each managed PageElement.
A direct text is a text that resides on the level directly below the selected HTML element. It does not include any text of the HTML element's nested children HTML elements.
can be used to skip the invocation of the getDirectText
function for some or all managed
PageElements. The results of skipped function invocations are not included in the total results array.
Returns the 'hasAnyDirectText' status of all PageElements managed by PageElementList as an array after performing the initial waiting condition of each managed PageElement.
A PageElement's 'hasAnyDirectText' status is set to true if the PageElement has any direct text.
A direct text is a text that resides on the level directly below the selected HTML element. It does not include any text of the HTML element's nested children HTML elements.
can be used to skip the invocation of the getHasAnyDirectText
function for some or all managed
PageElements. The results of skipped function invocations are not included in the total results array.
Returns the 'hasAnyText' status of all PageElements managed by PageElementList as an array after performing the initial waiting condition of each managed PageElement.
A PageElement's 'hasAnyText' status is set to true if the PageElement has any text.
can be used to skip the invocation of the getHasAnyText
function for some or all managed
PageElements. The results of skipped function invocations are not included in the total results array.
Returns the 'hasAnyValue' status of all ValuePageElements managed by ValuePageElementList as an array after performing the initial waiting condition of ValuePageElementList and each managed ValuePageElement.
A ValuePageElement's 'hasAnyValue' status is set to true if the ValuePageElement has any value.
can be used to skip the invocation of the getHasAnyValue
function for some or all managed
ValuePageElements. The results of skipped function invocations are not included in the total results array.
Returns the 'hasDirectText' status of all PageElements managed by PageElementList as an array after performing the initial waiting condition each managed PageElement.
A PageElement's 'hasDirectText' status is set to true if its actual direct text equals the expected direct text.
A direct text is a text that resides on the level directly below the selected HTML element. It does not include any text of the HTML element's nested children HTML elements.
the expected direct text used in the comparisons which set the 'hasDirectText' status.
If directText
is a single value, this value is compared to each element in the array of actual values of all
PageElements.
If directText
is an array of values, its length must match the length of PageElementList and the values of its
array elements are compared to the array of actual values of all PageElements.
Returns the 'hasText' status of all PageElements managed by PageElementList as an array after performing the initial waiting condition of each managed PageElement.
A PageElement's 'hasText' status is set to true if its actual text equals the expected text.
the expected text used in the comparisons which set the 'hasText' status
If text
is a single value, this value is compared to each element in the array of actual values of all
PageElements.
If text
is an array of values, its length must match the length of PageElementList and the values of its array
elements are compared to the array of actual values of all PageElements.
Returns the 'hasValue' status of all ValuePageElements managed by ValuePageElementList as an array after performing the initial waiting condition of ValuePageElementList and each managed ValuePageElement.
A ValuePageElement's 'hasValue' status is set to true if its actual value equals the expected value.
the expected value used in the comparisons which set the 'hasValue' status
If value
is a single value, this value is compared to each element in the array of actual values of all
ValuePageElements.
If value
is an array of values, its length must match the length of ValuePageElementList and the values of its
array elements are compared to the array of actual values of all ValuePageElements.
Returns the default interval that a PageElementList uses if no other explicit interval is passed to one of its functions which operates with intervals (eg. wait, eventually)
Returns the 'enabled' status of all PageElements managed by PageElementList as an array after performing the initial waiting condition of each managed PageElement.
can be used to skip the invocation of the getIsEnabled
function for some or all managed
PageElements. The results of skipped function invocations are not included in the total results array.
Returns the current number of PageElements managed by PageElementList (the number of PageElements found in the DOM which are identified by PageElementList's XPath selector).
Returns the XPath selector that identifies all PageElements managed by PageElementList.
Returns the texts of all PageElements managed by PageElementList as an array after performing the initial waiting condition of each managed PageElement.
can be used to skip the invocation of the getText
function for some or all managed
PageElements. The results of skipped function invocations are not included in the total results array.
Returns the default timeout that a PageElementList uses if no other explicit timeout is passed to one of its functions which operates with timeouts (eg. wait, eventually)
Returns the values of all ValuePageElements managed by ValuePageElementList as an array after performing the initial waiting condition of ValuePageElementList and each managed ValuePageElement.
can be used to skip the invocation of the getValue
function for some or all managed
ValuePageElements. The results of skipped function invocations are not included in the total results array.
This function identifies PageElements managed by PageElementList with the aid of an identifier
's mappingObject
and mappingFunc
.
It returns an identification results object which allows for PageElements managed by PageElementList to be accessed
via the key names of mappingObject
's properties. To create this results object, an "identification process" needs
to be performed:
mappingFunc
is executed on each fetched PageElement and its return value is compared to the values of
mappingObject
's properties.mappingFunc
's return value and the value of a mappingObject
's property,
a new property is written to the results object whose key name is taken from the matched mappingObject
's property
and whose value is the PageElement on which mappingFunc
was invoked.By default, the identification results object is cached for future invocations of the identify
method. This
behavior can be overwritten by passing a resetCache
flag to the identify
method.
Disabling the identification results cache can be useful if the contents of a PageElementList change often.
If the contents of a PageElementList rarely change, PageElementList's identify
function can be invoked with the
resetCache
flag set to true in order to repeat the "identification process" for a changed page content.
Be aware that the invocation of identify
can be quite slow (if no identification result is cached yet) because
PageElementList needs to fetch all managed PageElements from the page before mappingFunc
can be executed on them.
Therefore, always prefer PageElementList's where
accessor to its identify
method for the identification of
managed PageElements. The only exception to this rule are cases in which the identification of PageElements cannot
be described by the modification of an XPath selector (eg. identifying PageElements via their location coordinates
on the page).
Use this method to initialize properties that rely on the this type which is not available in the constructor.
Make sure that this method is invoked immediately after construction.
creates a copy of PageElementList which manages a subset of the original list's PageElements
Sets a new default identifier
for PageElementList's identify
function.
used to identify a PageElementList's managed PageElements via the key names defined in
identifier
's mappingObject
by matching mappingObject
's values with the return values of identifier
's
mappingFunc
This function sets the passed value(s) to all ValuePageElements managed by ValuePageElementList after performing the initial waiting condition of ValuePageElementList and each managed ValuePageElement.
If values is an array, the number of list elements must match the number of passed values. The values will be assigned in the order that the list elements were retrieved from the DOM.
a single value or an array of values
If values
is a single value, all managed ValuePageElements are set to this value.
If values
is an array of values, its length must match the length of ValuePageElementList and the managed
ValuePageElements are set to the values of the values
array in the order that the ValuePageElements were
retrieved from the DOM.
this (an instance of PageElementList)
Generated using TypeDoc
ValuePageElementList extends PageElementList with the possibility to set, retrieve and check the values of ValuePageElements managed by ValuePageElementList.
It also adds another initial waiting condition:
Store type of the PageNodeStore instance which can be used to retrieve/create PageNodes
PageElementType type of the ValuePageElement managed by ValuePageElementList
PageElementOpts type of the opts parameter passed to the constructor function of the ValuePageElements managed by ValuePageElementList
ValueType type of the value of the ValuePageElements managed by ValuePageElementList