select
Use the 'select' tool in the chromium-arm64 MCP server to choose an option from a dropdown on a webpage by specifying the element's CSS selector and desired value for browser automation and testing.
Instructions
Select an option from a dropdown
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for the select element | |
| value | Yes | Value to select |
Implementation Reference
- index.js:750-774 (handler)The main handler function for the 'select' tool. It uses CDP to evaluate JavaScript that finds the select element by CSS selector, sets its value, and dispatches a change event.async select(selector, value) { await this.ensureChromium(); const result = await this.sendCDPCommand('Runtime.evaluate', { expression: ` const select = document.querySelector('${selector}'); if (select) { select.value = '${value}'; select.dispatchEvent(new Event('change', { bubbles: true })); true; } else { false; } `, returnByValue: true }); if (!result.result?.value) { throw new Error(`Select element not found: ${selector}`); } return { content: [{ type: 'text', text: `Selected '${value}' in ${selector}` }], }; }
- index.js:213-229 (schema)The tool schema and registration definition, including name, description, and input schema specifying 'selector' and 'value' parameters.{ name: 'select', description: 'Select an option from a dropdown', inputSchema: { type: 'object', properties: { selector: { type: 'string', description: 'CSS selector for the select element', }, value: { type: 'string', description: 'Value to select', }, }, required: ['selector', 'value'], },
- index.js:366-366 (registration)The dispatch case in the CallToolRequestSchema handler that routes calls to the select tool handler.return await this.select(args.selector, args.value);