browsercat_select
Select an option from a dropdown menu on a webpage using CSS selectors to automate form interactions and web testing.
Instructions
Select an option from a dropdown menu
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for select element | |
| value | Yes | Value to select |
Implementation Reference
- index.ts:262-281 (handler)Implementation of the browsercat_select tool handler. Waits for the selector, selects the option by value using Puppeteer, and returns success or error message.case "browsercat_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, }; }
- index.ts:77-88 (registration)Registration of the browsercat_select tool in the TOOLS array, defining its name, description, and input schema.{ name: "browsercat_select", description: "Select an option from a dropdown menu", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for select element" }, value: { type: "string", description: "Value to select" }, }, required: ["selector", "value"], }, },