How to use the WebElement function from selenium-webdriver

Find comprehensive JavaScript selenium-webdriver.WebElement code examples handpicked from public code repositorys.

-3
fork icon1
star icon3
watch icon0

+ 2 other calls in file

19
20
21
22
23
24
25
26
27
28
this.EventEmitter = webdriver.EventEmitter;
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;
fork icon1
star icon0
watch icon2

168
169
170
171
172
173
174
175
176
if (selector instanceof ShadowRoot) {
  return resolve(selector);
}

if (selector[WEB_ELEMENT_ID] && isFunction(selector.getId)) {
  const webElement = new WebElement(this.driver, selector.getId());

  return resolve(webElement);
}
fork icon0
star icon0
watch icon0

+ 2 other calls in file

21
22
23
24
25
26
27
28
29
30
  if (webElementOrString instanceof WebElement) {
    return webElementOrString;
  }

  if (isString(webElementOrString)) {
    return new WebElement(this.driver, webElementOrString);
  }

  throw new Error(`Unknown element: ${webElementOrString}`);
}
fork icon0
star icon0
watch icon0

43
44
45
46
47
48
49
50
51
52
EventEmitter = webdriver.EventEmitter;
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;
fork icon0
star icon0
watch icon35

+ 5 other calls in file