Class webdriver.AlertPromise

code »
webdriver.Alert
  └ webdriver.AlertPromise
All implemented interfaces:
webdriver.promise.Thenable.<webdriver.Alert>

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:


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

Constructor

webdriver.AlertPromise ( driver, alert )
Parameters
driver: !webdriver.WebDriver
The driver controlling the browser this alert is attached to.
alert: !webdriver.promise.Thenable
A thenable that will be fulfilled with the promised alert.
Show:

Instance Methods

Defined in webdriver.AlertPromise

code »isPending ( )boolean
code »then ( )webdriver.promise.Promise
code »thenCatch ( )webdriver.promise.Promise
code »thenFinally ( )webdriver.promise.Promise

Defined in webdriver.Alert

Accepts this alert.

Returns
A promise that will be resolved when this command has completed.

Dismisses this alert.

Returns
A promise that will be resolved when this command has completed.

Retrieves the message text displayed with this alert. For instance, if the alert were opened with alert("hello"), then this would return "hello".

Returns
A promise that will be resolved to the text displayed with this alert.

Sets the response text on this alert. This command will return an error if the underlying alert does not support response text (e.g. window.alert and window.confirm).

Parameters
text: string
The text to set.
Returns
A promise that will be resolved when this command has completed.

Instance Properties

Defined in webdriver.Alert

Static Properties