Skip to main content
Glama

playwright_iframe_click

Interact with elements inside iframes on a webpage by specifying iframe and element selectors, enabling precise actions in web automation and testing scenarios.

Instructions

Click an element in an iframe on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
iframeSelectorYesCSS selector for the iframe containing the element to click
selectorYesCSS selector for the element to click

Implementation Reference

  • IframeClickTool class containing the execute method that performs the iframe click using Playwright frameLocator and locator.click()
    export class IframeClickTool extends BrowserToolBase { /** * Execute the iframe click tool */ async execute(args: any, context: ToolContext): Promise<ToolResponse> { return this.safeExecute(context, async (page) => { const frame = page.frameLocator(args.iframeSelector); if (!frame) { return createErrorResponse(`Iframe not found: ${args.iframeSelector}`); } await frame.locator(args.selector).click(); return createSuccessResponse(`Clicked element ${args.selector} inside iframe ${args.iframeSelector}`); }); } }
  • Input schema definition for the playwright_iframe_click tool, specifying required iframeSelector and selector parameters
    { name: "playwright_iframe_click", description: "Click an element in an iframe on the page", inputSchema: { type: "object", properties: { iframeSelector: { type: "string", description: "CSS selector for the iframe containing the element to click" }, selector: { type: "string", description: "CSS selector for the element to click" }, }, required: ["iframeSelector", "selector"], }, },
  • Tool registration in the main handleToolCall switch statement, dispatching to iframeClickTool.execute
    case "playwright_iframe_click": return await iframeClickTool.execute(args, context);
  • Instantiation of the IframeClickTool instance used for handling the tool call
    if (!iframeClickTool) iframeClickTool = new IframeClickTool(server);
  • Import of the IframeClickTool class from its implementation file
    IframeClickTool,

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

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