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

Method findElement

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

* Schedule a command to find a descendant of this ShadowROot. 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 * fact

(locator)

Source from the content-addressed store, hash-verified

3305 * element will be invalidated and all scheduled commands aborted.
3306 */
3307 findElement(locator) {
3308 locator = by.checkedLocator(locator)
3309 let id
3310 if (typeof locator === 'function') {
3311 id = this.driver_.findElementInternal_(locator, this)
3312 } else {
3313 let cmd = new command.Command(command.Name.FIND_ELEMENT_FROM_SHADOWROOT)
3314 .setParameter('using', locator.using)
3315 .setParameter('value', locator.value)
3316 id = this.execute_(cmd)
3317 }
3318 return new ShadowRootPromise(this.driver_, id)
3319 }
3320
3321 /**
3322 * 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