.findElement(matcher, options)
Retrieves matching element found within parent. Useful when a direct locator strategy isn't available unless scoped to an element.
Usage
element(matcher).findElement(matcher, options)
Parameters
matcher
(Matcher
): Matcher to define the locator strategy.options
(Object?
):options.sliderRange
(Tuple<Number, Number>?
): Provides cross-platform consistency when retrieving the value of a slider. The first number in the tuple is the minimum value, while the second number is the maximum value of the slider (e.g.[0, 1]
).
Returns
Element
: The first matching element found within parent.
Support
Platform | Supported |
---|---|
iOS | Yes |
Android | Yes |
Web | Yes |
Examples
Find text element within button:
const { element, by, expect } = require("appdriver");
(async () => {
const $text = await element(by.label("button"))
.findElement(by.label("text"));
return expect($text).toHaveText("Press Me!");
})();