MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / findElement

Method findElement

javascript/selenium-webdriver/lib/webdriver.js:2656–2668  ·  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

2654 * element will be invalidated and all scheduled commands aborted.
2655 */
2656 findElement(locator) {
2657 locator = by.checkedLocator(locator)
2658 let id
2659 if (typeof locator === 'function') {
2660 id = this.driver_.findElementInternal_(locator, this)
2661 } else {
2662 let cmd = new command.Command(command.Name.FIND_CHILD_ELEMENT)
2663 .setParameter('using', locator.using)
2664 .setParameter('value', locator.value)
2665 id = this.execute_(cmd)
2666 }
2667 return new WebElementPromise(this.driver_, id)
2668 }
2669
2670 /**
2671 * 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