API …
Web elements

Alerts, modals & popups

Native JavaScript dialogs, an accessible custom modal, cookie banner, entry ad, exit intent and new windows.

Practice tasks

  • Register page.on('dialog') and accept/dismiss alert, confirm and prompt.
  • Type into the prompt and assert the echoed text.
  • Open the modal, press Escape and assert it closes.
  • Enable the entry ad, wait for it, and close it.
  • Click “Open popup window” and switch to the new page.

More Web elements practice