Skip to main content
Glama

playwright_hover

Simulate hovering over a specific web element using a CSS selector. This tool enables precise interaction with web pages for testing or automation purposes within a Playwright-based browser environment.

Instructions

Hover an element on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for element to hover

Implementation Reference

  • The core handler implementation for the 'playwright_hover' tool. It waits for the selector, hovers over the element using Playwright's page.hover, and returns a success message.
    export class HoverTool extends BrowserToolBase { /** * Execute the hover tool */ async execute(args: any, context: ToolContext): Promise<ToolResponse> { return this.safeExecute(context, async (page) => { await page.waitForSelector(args.selector); await page.hover(args.selector); return createSuccessResponse(`Hovered ${args.selector}`); }); } }
  • The input schema definition for the 'playwright_hover' tool, specifying the required 'selector' parameter.
    name: "playwright_hover", description: "Hover an element on the page", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to hover" }, }, required: ["selector"], }, },
  • Registration and dispatch of the 'playwright_hover' tool in the main tool handler switch statement, calling the HoverTool's execute method.
    case "playwright_hover": return await hoverTool.execute(args, context);
  • src/tools.ts:458-458 (registration)
    The tool is listed in the BROWSER_TOOLS array, used to determine browser requirements.
    "playwright_hover",
  • Helper for code generation: handles 'playwright_hover' case in test code generator.
    case 'playwright_hover':

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/executeautomation/mcp-playwright'

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