playwright-browser-handle-dialog
To accept or dismiss browser dialogs like alert/confirm/prompt, handle the dialog so automation can continue.
When & Why to Use This Skill
This Claude skill enables automated interaction with browser-native dialogs such as alerts, confirmations, and prompts using Playwright. It ensures that web automation workflows and browser-based agents can proceed without manual intervention by programmatically accepting or dismissing pop-ups and providing required input text.
Use Cases
- Automated End-to-End Testing: Automatically handle confirmation dialogs during user journey testing to ensure test suites run to completion without stalling.
- Robust Web Scraping: Bypass unexpected browser alerts or information pop-ups on legacy websites that would otherwise interrupt data extraction processes.
- Form Submission Workflows: Programmatically provide necessary responses to browser 'prompt' dialogs during complex multi-step web registrations or data entries.
- Headless Browser Management: Maintain flow control in headless environments where manual interaction with UI dialogs is impossible.
| name | playwright-browser-handle-dialog |
|---|---|
| description | "To accept or dismiss browser dialogs like alert/confirm/prompt, handle the dialog so automation can continue." |
Usage
Use the MCP tool dev-swarm.request to send the payload as a JSON string:
{"server_id":"playwright","tool_name":"browser_handle_dialog","arguments":{}}
Tool Description
Handle a dialog
Arguments Schema
The schema below describes the arguments object in the request payload.
{
"type": "object",
"properties": {
"accept": {
"type": "boolean",
"description": "Whether to accept the dialog."
},
"promptText": {
"type": "string",
"description": "The text of the prompt in case of a prompt dialog."
}
},
"required": [
"accept"
],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#"
}
Background Tasks
If the tool returns a task id, poll the task status via the MCP request tool:
{"server_id":"playwright","method":"tasks/status","params":{"task_id":"<task_id>"}}