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

Function elementTextContains

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

* Creates a condition that will wait for the given element's * webdriver.WebDriver#getText visible text to contain the given * substring. * * @param {!./webdriver.WebElement} element The element to test. * @param {string} substr The substring to search for. * @return {!WebElementCondit

(element, substr)

Source from the content-addressed store, hash-verified

382 * @see webdriver.WebDriver#getText
383 */
384function elementTextContains(element, substr) {
385 return new WebElementCondition('until element text contains', function () {
386 return element.getText().then((t) => (t.indexOf(substr) != -1 ? element : null))
387 })
388}
389
390/**
391 * Creates a condition that will wait for the given element's

Callers

nothing calls this directly

Calls 1

getTextMethod · 0.65

Tested by

no test coverage detected