browser_double_click
Perform double-click actions on web elements during browser automation testing. Use locator strategies like ID, CSS, or XPath to target specific elements for double-click interactions in automated workflows.
Instructions
Perform double click on an element
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| by | Yes | Locator strategy to find element | |
| timeout | No | Maximum time to wait for element in milliseconds | |
| value | Yes | Value for the locator strategy |
Implementation Reference
- src/services/actionService.ts:32-37 (handler)Core handler function that locates the element and performs double-click using Selenium WebDriver actions.async doubleClickElement(params: LocatorParams): Promise<void> { const locator = LocatorFactory.createLocator(params.by, params.value); const element = await this.driver.wait(until.elementLocated(locator), params.timeout || 15000); const actions = this.driver.actions({ bridge: true }); await actions.doubleClick(element).perform(); }
- src/tools/actionTools.ts:92-115 (registration)Registers the MCP tool 'browser_double_click' with input schema and thin wrapper handler delegating to ActionService.server.tool( 'browser_double_click', 'Perform double click on an element', { ...locatorSchema }, async ({ by, value, timeout = 15000 }) => { try { const driver = stateManager.getDriver(); const actionService = new ActionService(driver); await actionService.doubleClickElement({ by, value, timeout }); return { content: [{ type: 'text', text: 'Double click performed' }], }; } catch (e) { return { content: [ { type: 'text', text: `Error performing double click: ${(e as Error).message}`, }, ], }; } } );
- src/types/index.ts:29-35 (schema)Zod schema defining the input parameters for element locators (by, value, optional timeout) used by the tool.export const locatorSchema = { by: z .enum(['id', 'css', 'xpath', 'name', 'tag', 'class', 'link', 'partialLink']) .describe('Locator strategy to find element'), value: z.string().describe('Value for the locator strategy'), timeout: z.number().optional().describe('Maximum time to wait for element in milliseconds'), };