Attach a file to an upload field
qa_uploadAttach a file to a page's file input—even a hidden one behind a styled dropzone or a native picker button—using a hostile test fixture, local path, or base64 content; batch multiple fields in one call.
Instructions
Put a file into an — including the hidden ones behind a styled dropzone, which a click can never reach. Three ways to choose what goes in: fixture for a hostile edge-case file (the upload counterpart of naughty strings — empty, oversize, wrong-type, corrupt, unicode name, unsanitised SVG…), path for a file on this machine, or content as base64. Pass content as base64 to attach a file YOU generated (a PDF fixture, a malformed CSV, an oversized image); omit it and Qiksy attaches a neutral test file matched to the field's accept. A content script has no filesystem access and the OS file picker is a modal an agent must never open, so bytes over this bridge are the only way a file from outside the browser gets in. AND WHERE THERE IS NO FILE INPUT AT ALL — a button that calls the native picker straight away, as YouTube Studio's audio-language dialog does — name that button with field and the file is handed to the picker it opens, exactly as a person choosing it would. The reply says via when that route was used, and it says so only when the page actually took the file. Delivery fires both paths uploaders use — assigning input.files + change, and a synthetic drop on the nearest dropzone — because react-dropzone-style components listen only for the second. SEVERAL FIELDS IN ONE CALL: pass files — an array of the same arguments — and they are attached in order, one round trip for the whole step instead of one per file.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "qa_upload"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | A ref from qa_snapshot | |
| name | No | File name, e.g. 'report.pdf' | |
| path | No | Absolute path to a file ON THIS MACHINE — the server reads and encodes it for you. Use this instead of `content` for anything bigger than a few hundred bytes. | |
| field | No | The upload CONTROL's accessible name — "Premises photos", "Company logo". Prefer this over a ref: an upload field is usually a hidden input behind a styled dropzone, and a step with two dropzones has two of them. Without a field (and without a ref or selector) the file lands in the page's FIRST file input, which is how two photos ended up attached to the logo. | |
| files | No | Attach several files in ONE call — each entry takes the same arguments as a single upload. Use this when a step has more than one upload field. | |
| tabId | No | Target tab (from qa_tabs); omit for the active tab | |
| content | No | Base64 file content, for a file you are holding in memory. Prefer `path`. | |
| fixture | No | A HOSTILE fixture built in the page, so it costs nothing to send: empty (0 bytes) · oversize (12MB) · wrong-type (a PNG named .pdf — is content checked or only the extension?) · corrupt (truncated PNG) · long-name (255 chars) · unicode-name (RTL + emoji + CJK) · svg-script (is an uploaded SVG sanitised?) · double-ext (invoice.pdf.exe — does the UI show the whole name?). The answer comes back as `asks`. | |
| mimeType | No | MIME type, e.g. 'application/pdf' | |
| selector | No | CSS selector of the file input or its dropzone; omit to use the page's first file input |