select
Set values in dropdown menus using CSS selectors to automate form interactions during consent management testing.
Instructions
Select an element with SELECT tag
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for element to select | |
| value | Yes | Value to select |
Implementation Reference
- src/index.ts:307-330 (handler)Handler implementation for the 'select' tool, using Puppeteer's page.waitForSelector and page.select methods.case "select": try { await page.waitForSelector(args.selector); await page.select(args.selector, args.value); return { content: [ { type: "text", text: `Selected ${args.selector} with: ${args.value}`, }, ], isError: false, }; } catch (error) { return { content: [ { type: "text", text: `Failed to select ${args.selector}: ${(error as Error).message}`, }, ], isError: true, }; }
- src/index.ts:80-94 (registration)Registration of the 'select' tool in the TOOLS array, including its name, description, and input schema.name: "select", description: "Select an element with SELECT tag", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to select", }, value: { type: "string", description: "Value to select" }, }, required: ["selector", "value"], }, }, {
- src/index.ts:80-94 (schema)Input schema definition for the 'select' tool, specifying selector and value parameters.name: "select", description: "Select an element with SELECT tag", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to select", }, value: { type: "string", description: "Value to select" }, }, required: ["selector", "value"], }, }, {