AlertPromise#

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

CODE
driver.switchTo().alert().dismiss();
driver.switchTo().alert().then(function(alert) {
return alert.dismiss();
});

Constructor#

new AlertPromise(drivernon-null, alertnon-null)#

Parameters:
NameTypeDescription
driverWebDriver

The driver controlling the browser this alert is attached to.

alertPromise.<!Alert>

A thenable that will be fulfilled with the promised alert.

Implements

Members#

catch#

then#

Methods#

accept()#

Defers action until the alert has been located.

dismiss()#

Defers action until the alert has been located.

getText()#

Defer returning text until the promised alert has been resolved.

sendKeys()#

Defers action until the alert has been located.