9. Handling Dialogs & Popups

Handling Dialogs

page.on("dialog", async (dialog) => {
  await dialog.accept();
});
await page.getByRole("button", { name: "Reset All" }).click();

Task

  • Register a `page.on("dialog")` listener to accept the dialog.
💡Common doubts
Did you like the problem?
Lesson 9 of 12
TypeScript
Loading code editor…
Next