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

Method normalize_

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

* @param {!Function} webElementPromise The webElement in unresolved state * @return {!Promise<!WebElement>} First single WebElement from array of resolved promises

(webElementPromise)

Source from the content-addressed store, hash-verified

1039 * @return {!Promise<!WebElement>} First single WebElement from array of resolved promises
1040 */
1041 async normalize_(webElementPromise) {
1042 let result = await webElementPromise
1043 if (result.length === 0) {
1044 throw new NoSuchElementError('Cannot locate an element with provided parameters')
1045 } else {
1046 return result[0]
1047 }
1048 }
1049
1050 /**
1051 * @param {!Function} locatorFn The locator function to use.

Callers 1

findElementMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected