Class webdriver.Alert
code »Represents a modal dialog such as alert
, confirm
, or
prompt
. Provides functions to retrieve the message displayed with
the alert, accept or dismiss the alert, and set the response text (in the
case of prompt
).
Constructor
webdriver.Alert ( driver, text )
Parameters |
---|
|
Show:
Instance Methods
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 |
|