Interface: IFindCommands
@appium/types.IFindCommands
Hierarchy
IFindCommands
↳ Driver
Table of contents
Methods
- findElOrEls
- findElOrElsWithProcessing
- findElement
- findElementFromElement
- findElementFromShadowRoot
- findElements
- findElementsFromElement
- findElementsFromShadowRoot
- getPageSource
Methods
findElOrEls
▸ findElOrEls<Mult, Ctx>(strategy, selector, mult, context?): Promise<Mult extends true ? Element<string>[] : Element<string>>
A helper method that returns one or more UI elements based on the search criteria
Type parameters
| Name | Type |
|---|---|
Mult |
extends boolean |
Ctx |
any |
Parameters
| Name | Type | Description |
|---|---|---|
strategy |
string |
the locator strategy |
selector |
string |
the selector |
mult |
Mult |
whether or not we want to find multiple elements |
context? |
Ctx |
the element to use as the search context basis if desiredCapabilities |
Returns
Promise<Mult extends true ? Element<string>[] : Element<string>>
A single element or list of elements
Defined in
appium/packages/types/lib/driver.ts:294
findElOrElsWithProcessing
▸ findElOrElsWithProcessing<Mult, Ctx>(strategy, selector, mult, context?): Promise<Mult extends true ? Element<string>[] : Element<string>>
This is a wrapper for findElOrEls that validates locator strategies
and implements the appium:printPageSourceOnFindFailure capability
Type parameters
| Name | Type |
|---|---|
Mult |
extends boolean |
Ctx |
any |
Parameters
| Name | Type | Description |
|---|---|---|
strategy |
string |
the locator strategy |
selector |
string |
the selector |
mult |
Mult |
whether or not we want to find multiple elements |
context? |
Ctx |
the element to use as the search context basis if desiredCapabilities |
Returns
Promise<Mult extends true ? Element<string>[] : Element<string>>
A single element or list of elements
Defined in
appium/packages/types/lib/driver.ts:312
findElement
▸ findElement(strategy, selector): Promise<Element<string>>
Find a UI element given a locator strategy and a selector, erroring if it can't be found
See
https://w3c.github.io/webdriver/#find-element
Parameters
| Name | Type | Description |
|---|---|---|
strategy |
string |
the locator strategy |
selector |
string |
the selector to combine with the strategy to find the specific element |
Returns
Promise<Element<string>>
The element object encoding the element id which can be used in element-related commands
Defined in
appium/packages/types/lib/driver.ts:210
findElementFromElement
▸ findElementFromElement(strategy, selector, elementId): Promise<Element<string>>
Find a UI element given a locator strategy and a selector, erroring if it can't be found. Only look for elements among the set of descendants of a given element
See
https://w3c.github.io/webdriver/#find-element-from-element
Parameters
| Name | Type | Description |
|---|---|---|
strategy |
string |
the locator strategy |
selector |
string |
the selector to combine with the strategy to find the specific element |
elementId |
string |
the id of the element to use as the search basis |
Returns
Promise<Element<string>>
The element object encoding the element id which can be used in element-related commands
Defined in
appium/packages/types/lib/driver.ts:235
findElementFromShadowRoot
▸ Optional findElementFromShadowRoot(strategy, selector, shadowId): Promise<Element<string>>
Find an element from a shadow root
See
https://w3c.github.io/webdriver/#find-element-from-shadow-root
Parameters
| Name | Type | Description |
|---|---|---|
strategy |
string |
the locator strategy |
selector |
string |
the selector to combine with the strategy to find the specific elements |
shadowId |
string |
the id of the element to use as the search basis |
Returns
Promise<Element<string>>
The element inside the shadow root matching the selector
Defined in
appium/packages/types/lib/driver.ts:263
findElements
▸ findElements(strategy, selector): Promise<Element<string>[]>
Find a a list of all UI elements matching a given a locator strategy and a selector
See
https://w3c.github.io/webdriver/#find-elements
Parameters
| Name | Type | Description |
|---|---|---|
strategy |
string |
the locator strategy |
selector |
string |
the selector to combine with the strategy to find the specific elements |
Returns
Promise<Element<string>[]>
A possibly-empty list of element objects
Defined in
appium/packages/types/lib/driver.ts:221
findElementsFromElement
▸ findElementsFromElement(strategy, selector, elementId): Promise<Element<string>[]>
Find a a list of all UI elements matching a given a locator strategy and a selector. Only look for elements among the set of descendants of a given element
See
https://w3c.github.io/webdriver/#find-elements-from-element
Parameters
| Name | Type | Description |
|---|---|---|
strategy |
string |
the locator strategy |
selector |
string |
the selector to combine with the strategy to find the specific elements |
elementId |
string |
the id of the element to use as the search basis |
Returns
Promise<Element<string>[]>
A possibly-empty list of element objects
Defined in
appium/packages/types/lib/driver.ts:248
findElementsFromShadowRoot
▸ Optional findElementsFromShadowRoot(strategy, selector, shadowId): Promise<Element<string>[]>
Find elements from a shadow root
See
https://w3c.github.io/webdriver/#find-element-from-shadow-root
Parameters
| Name | Type | Description |
|---|---|---|
strategy |
string |
the locator strategy |
selector |
string |
the selector to combine with the strategy to find the specific elements |
shadowId |
string |
the id of the element to use as the search basis |
Returns
Promise<Element<string>[]>
A possibly empty list of elements inside the shadow root matching the selector
Defined in
appium/packages/types/lib/driver.ts:278
getPageSource
▸ getPageSource(): Promise<string>
Get the current page/app source as HTML/XML
See
https://w3c.github.io/webdriver/#get-page-source
Returns
Promise<string>
The UI hierarchy in a platform-appropriate format (e.g., HTML for a web page)