fill
Enter text into web form fields using CSS selectors to automate data input during browser testing on ARM64 devices.
Instructions
Fill an input field
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for the input field | |
| value | Yes | Value to fill |
Implementation Reference
- index.js:677-687 (handler)The core handler function for the 'fill' MCP tool. Ensures the Chromium browser is running, clicks on the target selector to focus the input field, then inserts the provided value using the Chrome DevTools Protocol (CDP) Input.insertText command.async fill(selector, value) { await this.ensureChromium(); await this.click(selector); // Focus element first // Clear and type await this.sendCDPCommand('Input.insertText', { text: value }); return { content: [{ type: 'text', text: `Filled ${selector} with: ${value}` }], }; }
- index.js:152-169 (schema)The input schema definition for the 'fill' tool as registered in the ListTools response, specifying the required 'selector' (CSS selector) and 'value' (string to fill) parameters.{ name: 'fill', description: 'Fill an input field', inputSchema: { type: 'object', properties: { selector: { type: 'string', description: 'CSS selector for the input field', }, value: { type: 'string', description: 'Value to fill', }, }, required: ['selector', 'value'], }, },
- index.js:357-358 (registration)The dispatch registration in the CallToolRequestSchema handler switch statement that routes 'fill' tool calls to the fill handler method.case 'fill': return await this.fill(args.selector, args.value);