w3c-webdriver
  • Introduction
  • Capabilities
  • Sessions
  • Timeouts
  • Navigation
  • Contexts
  • Elements
  • Document
  • Cookies
  • Actions
  • User prompts
  • Screen capture
  • Examples
    • Cucumber Functional Tests
  • Resources
    • GitHub
    • WebDriver spec
    • MDN docs
Powered by GitBook
On this page
  • session.dismissAlert()
  • session.acceptAlert()
  • session.getAlertText()
  • session.sendAlertText(text)

Was this helpful?

User prompts

PreviousActionsNextScreen capture

Last updated 3 years ago

Was this helpful?

session.dismissAlert()

Dismiss the alert in current page

RETURNS

Promise<void>

EXAMPLES

await session.dismissAlert();

SEE ALSO

session.acceptAlert()

Accept the alert in current page

RETURNS

Promise<void>

EXAMPLES

await session.acceptAlert();

SEE ALSO

session.getAlertText()

Returns the text from an alert

RETURNS

Promise<string>

EXAMPLES

const alertText = await session.getAlertText();

SEE ALSO

session.sendAlertText(text)

Sets the text field of a prompt to the given value.

PARAMETERS

  • text: string - Text to be set in the input area of alert

RETURNS

Promise<void>

EXAMPLES

await session.sendAlertText('Test');

SEE ALSO

WebDriver spec
WebDriver spec
WebDriver spec
WebDriver spec