How to use the WebElementPromise function from selenium-webdriver
Find comprehensive JavaScript selenium-webdriver.WebElementPromise code examples handpicked from public code repositorys.
51 52 53 54 55 56 57 58 59 60
const fwd = scope.driver_ || scope; const el = this.filters ? this.all(scope).then(matches => this.assert(matches[0])) : scope.findElement(this.by).catch(() => this.assert()); const elementPromise = new webdriver.WebElementPromise(fwd, el); return fwd._decorateElement(elementPromise); }; Query.prototype.findAll = function (scope) {
GitHub: shootdaj/MIDIatorModules
![shootdaj profile picture](/shootdaj.png?size=40)
20 21 22 23 24 25 26 27 28 29
this.FileDetector = webdriver.FileDetector; this.Key = webdriver.Key; this.Session = webdriver.Session; this.WebDriver = webdriver.WebDriver; this.WebElement = webdriver.WebElement; this.WebElementPromise = webdriver.WebElementPromise; this.error = webdriver.error; this.logging = webdriver.logging; this.promise = webdriver.promise; this.until = webdriver.until;
146 147 148 149 150 151 152 153 154 155
if (!selector) { return null; } // eslint-disable-next-line no-async-promise-executor return new WebElementPromise(this.driver, new Promise(async (resolve, reject) => { if (selector instanceof Promise) { try { selector = await selector; } catch (error) {
+ 5 other calls in file
13 14 15 16 17 18 19 20 21 22
await this.driver.wait(until.elementIsEnabled(element), this.milisecondsTimeout); await this.driver.sleep(this.milisecondsDelay); const el = await this.driver.findElement(_locator); return el; }; return new WebElementPromise(this.driver, _getElement(locator)); } async elementExists(locator) { try {
GitHub: blend/protractor
![blend profile picture](/blend.png?size=40)
44 45 46 47 48 49 50 51 52 53
FileDetector = webdriver.FileDetector; Key = webdriver.Key; Session = webdriver.Session; WebDriver = webdriver.WebDriver; WebElement = webdriver.WebElement; WebElementPromise = webdriver.WebElementPromise; error = webdriver.error; logging = webdriver.logging; promise = webdriver.promise; until = webdriver.until;
+ 5 other calls in file
GitHub: dewdad/selene
![dewdad profile picture](/dewdad.png?size=40)
51 52 53 54 55 56 57 58 59 60
const selene = scope.driver_ || scope; const el = this.filters ? this.all(scope).then(matches => this.assert(matches[0])) : scope.findElement(this.by).catch(() => this.assert()); const elementPromise = new webdriver.WebElementPromise(selene, el); return selene._decorateElement(elementPromise); }; Query.prototype.findAll = function (scope) {
selenium-webdriver.Builder is the most popular function in selenium-webdriver (1701 examples)