API Docs for: 0.2.7
Show:

Alert Class

Defined in: lib/alert.js:8
Module: Navigation
Parent Module: WebDriver

Alert window management

Handles regular alerts, prompts, and confirms.

Constructor

Alert

(
  • driver
)

Defined in lib/alert.js:8

Parameters:

Methods

_logMethodCall

(
  • event
)
private

Defined in lib/alert.js:28

Logs a method call by an event

Parameters:

_requestJSON

(
  • method
  • path
  • [body]
)
private

Defined in lib/alert.js:41

Performs a context dependent JSON request for the current session. The result is parsed for errors.

Parameters:

Returns:

:

accept

()

Defined in lib/alert.js:94

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

dismiss

()

Defined in lib/alert.js:104

Dismisses the currently displayed alert dialog. For confirm() and prompt() dialogs, this is equivalent to clicking the 'Cancel' button. For alert() dialogs, this is equivalent to clicking the 'OK' button.

Note: Never use this with an alert. Use accept() instead.

getText

() String

Defined in lib/alert.js:72

Gets the text of the currently displayed JavaScript alert(), confirm(), or prompt() dialog

Returns:

setText

(
  • text
)

Defined in lib/alert.js:82

Sends keystrokes to a JavaScript prompt() dialog

Parameters: