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

Function elementLocated

javascript/selenium-webdriver/lib/until.js:228–236  ·  view source on GitHub ↗

* Creates a condition that will loop until an element is * ./webdriver.WebDriver#findElement found with the given locator. * * @param {!(By|Function)} locator The locator to use. * @return {!WebElementCondition} The new condition.

(locator)

Source from the content-addressed store, hash-verified

226 * @return {!WebElementCondition} The new condition.
227 */
228function elementLocated(locator) {
229 locator = by.checkedLocator(locator)
230 let locatorStr = typeof locator === 'function' ? 'by function()' : locator + ''
231 return new WebElementCondition('for element to be located ' + locatorStr, function (driver) {
232 return driver.findElements(locator).then(function (elements) {
233 return elements[0]
234 })
235 })
236}
237
238/**
239 * Creates a condition that will loop until at least one element is

Callers

nothing calls this directly

Calls 1

findElementsMethod · 0.65

Tested by

no test coverage detected