Capture Screenshot
captureScreenshotCapture webpage screenshots with optional pre-capture interactions like filling forms, clicking elements, and waiting for content.
Instructions
Capture webpage screenshot with optional pre-capture interactions.
PARAMS: • url (required): Page URL • steps (optional): Array of 6 step types (order auto-fixed) • headers (optional): HTTP auth headers • validate (optional): Dry-run step validation
6 STEPS (all optional, order doesn't matter): • viewport: { device: "mobile" } - Set device/screen • wait: { for: ".loaded" } or { duration: 2000 } - Wait for element or time • fill: { target: "#email", value: "a@b.com" } - Fill form field • click: { target: "#btn", waitFor: ".result" } - Click element • scroll: { to: "#footer" } or { y: 500 } - Scroll page • screenshot: { fullPage: true } - Capture (auto-added if omitted)
COMMON ERRORS & FIXES: • ELEMENT_NOT_FOUND → Add wait step before the failing step • ELEMENT_NOT_VISIBLE → Add scroll step before the failing step
EXAMPLE: { "url": "...", "steps": [{ "type": "fill", "target": "#email", "value": "a@b.com" }, { "type": "click", "target": "#submit", "waitFor": ".dashboard" }] }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The webpage URL to capture. | |
| steps | No | Steps to execute before capture. Order: viewport → wait → fill → click → scroll → screenshot | |
| headers | No | HTTP headers for authentication (e.g., { 'Authorization': 'Bearer token' }). |