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 |
|---|
|
Show:
Instance Methods
Defined in webdriver.AlertPromise
code »thenFinally ( ) ⇒ webdriver.promise.Promise
webdriver.promise.PromiseDefined in webdriver.Alert
code »accept ( ) ⇒ !webdriver.promise.Promise.<void>Accepts this alert.
!webdriver.promise.Promise.<void>| Returns |
|---|
|
code »dismiss ( ) ⇒ !webdriver.promise.Promise.<void>Dismisses this alert.
!webdriver.promise.Promise.<void>| Returns |
|---|
|
code »getText ( ) ⇒ !webdriver.promise.Promise.<string>Retrieves the message text displayed with this alert. For instance, if the
alert were opened with alert("hello"), then this would return "hello".
!webdriver.promise.Promise.<string>| Returns |
|---|
|
code »sendKeys ( text ) ⇒ !webdriver.promise.Promise.<void>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).
!webdriver.promise.Promise.<void>| Parameters |
|---|
|
| Returns |
|