MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / findElement

Method findElement

javascript/selenium-webdriver/lib/webdriver.js:2782–2794  ·  view source on GitHub ↗

* Schedule a command to find a descendant of this element. If the element * cannot be found, the returned promise will be rejected with a * plain error.NoSuchElementError NoSuchElementError. * * The search criteria for an element may be defined using one of the static * factori

(locator)

Source from the content-addressed store, hash-verified

2780 * element will be invalidated and all scheduled commands aborted.
2781 */
2782 findElement(locator) {
2783 locator = by.checkedLocator(locator)
2784 let id
2785 if (typeof locator === 'function') {
2786 id = this.driver_.findElementInternal_(locator, this)
2787 } else {
2788 let cmd = new command.Command(command.Name.FIND_CHILD_ELEMENT)
2789 .setParameter('using', locator.using)
2790 .setParameter('value', locator.value)
2791 id = this.execute_(cmd)
2792 }
2793 return new WebElementPromise(this.driver_, id)
2794 }
2795
2796 /**
2797 * Locates all the descendants of this element that match the given search

Callers

nothing calls this directly

Calls 3

execute_Method · 0.95
findElementInternal_Method · 0.80
setParameterMethod · 0.80

Tested by

no test coverage detected