wait_for_element
Pause execution until a specific element appears in the Firefox browser, using a selector and optional timeout for efficient automation and debugging workflows.
Instructions
Wait for element to appear
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | ||
| tabId | No | ||
| timeout | No |
Implementation Reference
- index-multi-debug.js:1291-1304 (handler)The core handler function that implements the wait_for_element tool logic using Playwright's page.waitForSelector to wait for the specified selector on the given tab/page.async waitForElement(args) { this.ensureBrowserRunning(); const { selector, timeout = 30000, tabId } = args; const page = this.getPage(tabId); await page.waitForSelector(selector, { timeout }); return { content: [{ type: 'text', text: `Element '${selector}' found in tab '${tabId || this.activeTabId}'` }] }; }
- index-multi-debug.js:210-222 (schema)The input schema and tool metadata definition returned in ListToolsRequestSchema response.{ name: 'wait_for_element', description: 'Wait for element to appear', inputSchema: { type: 'object', properties: { selector: { type: 'string' }, timeout: { type: 'number', default: 30000 }, tabId: { type: 'string' } }, required: ['selector'] } },
- index-multi-debug.js:423-425 (registration)The switch case in CallToolRequestSchema handler that registers and dispatches calls to the waitForElement handler.case 'wait_for_element': return await this.waitForElement(args); case 'execute_script':