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

Function elementsLocated

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

* Creates a condition that will loop until at least one element is * ./webdriver.WebDriver#findElement found with the given locator. * * @param {!(By|Function)} locator The locator to use. * @return {!Condition<!Array<!./webdriver.WebElement>>} The new * condition.

(locator)

Source from the content-addressed store, hash-verified

244 * condition.
245 */
246function elementsLocated(locator) {
247 locator = by.checkedLocator(locator)
248 let locatorStr = typeof locator === 'function' ? 'by function()' : locator + ''
249 return new Condition('for at least one element to be located ' + locatorStr, function (driver) {
250 return driver.findElements(locator).then(function (elements) {
251 return elements.length > 0 ? elements : null
252 })
253 })
254}
255
256/**
257 * Creates a condition that will wait for the given element to become stale. An

Callers

nothing calls this directly

Calls 1

findElementsMethod · 0.65

Tested by

no test coverage detected