session_set_files
Programmatically select files on a hidden file input: supply base64 content, filename, and MIME type; assigns File objects to input.files and fires input/change events to trigger onChange handlers.
Instructions
Select files on a file input programmatically (Playwright setInputFiles semantics): builds File objects from base64 content, assigns them to input.files, then dispatches input+change so framework onChange handlers fire. Selector-addressed because file inputs are often hidden and absent from the session_state index.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"session_id": "<session_id>",
"selector": "<selector>",
"files": "<files>"
},
"name": "session_set_files"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | Files to select | |
| selector | Yes | CSS selector for the file input, e.g. "input[type=file]". File inputs are often hidden, so this is selector-addressed rather than using the /state index. | |
| session_id | Yes | Session ID |