alertAccept

Accepts the currently displayed alert dialog. Usually, this is equivalent to clicking on the ‘OK’ button in the dialog.

Usage

1
browser.alertAccept();

Example

alertAccept.js
1
2
3
4
5
6
7
8
it('demonstrate the alertAccept command', function () {
try {
browser.alertAccept();
} catch (e) {
// no alert found
}
// ...
});

Throws

  • RuntimeError: If no alert is present. The seleniumStack.type parameter will equal ‘NoAlertOpenError’.