browser_run_code
Execute Playwright JavaScript functions to automate browser interactions, such as clicking elements and retrieving page data, in isolated sessions.
Instructions
Run Playwright code snippet
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | A JavaScript function containing Playwright code to execute. It will be invoked with a single argument, page, which you can use for any page interaction. For example: `async (page) => { await page.getByRole('button', { name: 'Submit' }).click(); return await page.title(); }` | |
| filename | No | Load code from the specified file. If both code and filename are provided, code will be ignored. | |
| sessionId | No | Target session ID. Omit to use the active session. |