Skip to main content
Glama

playwright_select

Automate dropdown selection on web pages by specifying a CSS selector and desired value, enabling precise control in browser interactions through Playwright and Chrome DevTools Protocol.

Instructions

Select an element on the page with Select tag

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for element to select
valueYesValue to select

Implementation Reference

  • Handler implementation for the 'playwright_select' tool. It waits for the specified selector to appear on the page and then selects the given option using Playwright's selectOption method. Returns success or error message accordingly.
    case "playwright_select": try { await page!.waitForSelector(args.selector); await page!.selectOption(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, }; }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lars-hagen/mcp-playwright-cdp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server