WebElementPromise

WebElementPromise is a promise that will be fulfilled with a WebElement. This serves as a forward proxy on WebElement, allowing calls to be scheduled without directly on this instance before the underlying WebElement has been fulfilled. In other words, the following two statements are equivalent:

driver.findElement({id: 'my-button'}).click();
driver.findElement({id: 'my-button'}).then(function(el) {
  return el.click();
});

Constructor

new WebElementPromise(drivernon-null, elnon-null)

Parameters:
NameTypeDescription
driverWebDriver

The parent WebDriver instance for this element.

elPromise.<!WebElement>

A promise that will resolve to the promised element.

Implements

Members

catch

then

Methods

getId()

Defers returning the element ID until the wrapped WebElement has been resolved.