.text(text)
Find element(s) by their text value.
Usage
by.text(text)
Returns
Matcher
: A matcher to be used when finding elements.
Support
Platform | Supported |
---|---|
iOS | Yes |
Android | Yes |
Web | Unknown |
Examples
Find an element with the text "Hello World!".
const { element, by } = require("appdriver");
(async () => {
const $text = await element(by.text("Hello World!"));
})();
Find an element containing the text "Success".
const { element, by } = require("appdriver");
(async () => {
const $text = await element(by.text(/Success/));
})();