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

Method normalize_

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

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

Callers 1

findElementMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected