MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / alert

Method alert

javascript/selenium-webdriver/lib/webdriver.js:2620–2629  ·  view source on GitHub ↗

* Changes focus to the active modal dialog, such as those opened by * `window.alert()`, `window.confirm()`, and `window.prompt()`. The returned * promise will be rejected with a * plain error.NoSuchAlertError if there are no open alerts. * * @return {!AlertPromise} The open ale

()

Source from the content-addressed store, hash-verified

2618 * @return {!AlertPromise} The open alert.
2619 */
2620 alert() {
2621 const text = this.driver_.execute(new command.Command(command.Name.GET_ALERT_TEXT))
2622 const driver = this.driver_
2623 return new AlertPromise(
2624 driver,
2625 text.then(function (text) {
2626 return new Alert(driver, text)
2627 }),
2628 )
2629 }
2630}
2631
2632//////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 1

executeMethod · 0.65

Tested by

no test coverage detected