Skip to content
masterclass Buddy

Playwright · Class

Dialog

A Dialog represents a browser alert, confirmation, prompt, or beforeunload dialog. Handle it from the page's dialog event, then accept or dismiss it.

Last updated

Since
before v1.9

Syntax

dialog.accept(prompt_text=None)
dialog.dismiss()
dialog.default_value
dialog.message
dialog.page
dialog.type

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • page.on("dialog")
  • accept
  • dismiss
  • default_value
  • message
  • page
  • type

Source: Dialog | Playwright Python. Checked 2026-11-03.