playwright_fill
Fill input fields on web pages using CSS selectors to automate form completion or data entry tasks in browser automation workflows.
Instructions
fill out an input field
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for input field | |
| value | Yes | Value to fill |
Implementation Reference
- src/tools/browser/interaction.ts:91-102 (handler)The FillTool.execute method implements the core logic of the 'playwright_fill' tool. It waits for the specified selector to appear, then uses Playwright's page.fill() to input the value into the element.export class FillTool extends BrowserToolBase { /** * Execute the fill tool */ async execute(args: any, context: ToolContext): Promise<ToolResponse> { return this.safeExecute(context, async (page) => { await page.waitForSelector(args.selector); await page.fill(args.selector, args.value); return createSuccessResponse(`Filled ${args.selector} with: ${args.value}`); }); } }
- src/tools.ts:149-160 (schema)Tool schema definition for 'playwright_fill', specifying name, description, and input schema requiring 'selector' and 'value' parameters.{ name: "playwright_fill", description: "fill out an input field", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for input field" }, value: { type: "string", description: "Value to fill" }, }, required: ["selector", "value"], }, },
- src/toolHandler.ts:490-495 (registration)Registration of 'playwright_fill' in the main tool handler switch statement, dispatching execution to the FillTool instance.case "playwright_iframe_fill": return await iframeFillTool.execute(args, context); case "playwright_fill": return await fillTool.execute(args, context);
- src/toolHandler.ts:22-32 (registration)Import of FillTool from interaction.js, necessary for tool instantiation and execution.import { ClickTool, IframeClickTool, FillTool, SelectTool, HoverTool, EvaluateTool, IframeFillTool, UploadFileTool } from './tools/browser/interaction.js'; import {
- src/tools.ts:455-456 (helper)'playwright_fill' listed in BROWSER_TOOLS array, used for conditional browser launching."playwright_iframe_fill", "playwright_fill",