* Locates all the descendants of this element that match the given search * criteria. * * @param {!(by.By|Function)} locator The locator strategy to use when * searching for the element. * @return {!Promise<!Array<!WebElement>>} A promise that will resolve to an * array of
(locator)
| 2677 | * array of WebElements. |
| 2678 | */ |
| 2679 | async findElements(locator) { |
| 2680 | locator = by.checkedLocator(locator) |
| 2681 | if (typeof locator === 'function') { |
| 2682 | return this.driver_.findElementsInternal_(locator, this) |
| 2683 | } else { |
| 2684 | let cmd = new command.Command(command.Name.FIND_CHILD_ELEMENTS) |
| 2685 | .setParameter('using', locator.using) |
| 2686 | .setParameter('value', locator.value) |
| 2687 | let result = await this.execute_(cmd) |
| 2688 | return Array.isArray(result) ? result : [] |
| 2689 | } |
| 2690 | } |
| 2691 | |
| 2692 | /** |
| 2693 | * Clicks on this element. |
nothing calls this directly
no test coverage detected