select
Simulate selecting a value from a dropdown on a webpage using a CSS selector. Designed for browser automation and web testing on ARM64 devices with Chromium ARM64 Browser.
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 handler function for the 'select' tool. It evaluates JavaScript to find the select element by CSS selector, sets its value, dispatches a change event, and returns success or throws if not found.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:214-230 (registration)Registration of the 'select' tool in the listTools response, including name, description, and input schema definition.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 switch case in the callTool handler that routes calls to the 'select' method.return await this.select(args.selector, args.value);
- index.js:216-229 (schema)Input schema definition for the 'select' tool, specifying required selector and value parameters.inputSchema: { type: 'object', properties: { selector: { type: 'string', description: 'CSS selector for the select element', }, value: { type: 'string', description: 'Value to select', }, }, required: ['selector', 'value'], },