browser_upload_file
Upload local files to a web page's file input by giving a file path and optional snapshot ref or CSS selector, or auto-detect the first file input; works on strict-CSP pages.
Instructions
Upload a file through a file input element. Uses CDP DOM.setFileInputFiles — works even on strict-CSP pages. Provide the local file path and either a ref from snapshot, a CSS selector targeting the file input, or omit both to auto-find the first input[type="file"].
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Element reference from snapshot (e.g. "e12") | |
| files | No | Array of local file paths to upload (multiple files) | |
| filePath | No | Local file path to upload (single file) | |
| selector | No | CSS selector for the file input element |