Constructor
new Alert(drivernon-null, text)
Name | Type | Description |
---|---|---|
driver | WebDriver | The driver controlling the browser this alert is attached to. |
text | string | The message text displayed with this alert. |
- Source
Methods
accept() → (non-null) {Promise.<void>}
Accepts this alert.
- Source
A promise that will be resolved when this command has completed.
- Type:
- Promise.<void>
dismiss() → (non-null) {Promise.<void>}
Dismisses this alert.
- Source
A promise that will be resolved when this command has completed.
- Type:
- Promise.<void>
getText() → (non-null) {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".
- Source
A promise that will be resolved to the text displayed with this alert.
- Type:
- Promise.<string>
sendKeys(text) → (non-null) {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).
Name | Type | Description |
---|---|---|
text | string | The text to set. |
- Source
A promise that will be resolved when this command has completed.
- Type:
- Promise.<void>