mqscript_element_click
Simulate user clicks on mobile UI elements by specifying element IDs or selectors for automated testing and interaction.
Instructions
Click on UI element
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| elementId | Yes | Element ID or selector |
Implementation Reference
- src/tools/extension-commands.ts:52-63 (handler)The handler function for the 'mqscript_element_click' tool. It takes an elementId, generates the corresponding MQScript 'Element.Click' command, and returns a formatted response with the script.handler: async (args: { elementId: string }) => { const { elementId } = args; const script = `Element.Click("${elementId}")`; return { content: [ { type: 'text', text: `Generated MQScript element click command:\n\`\`\`\n${script}\n\`\`\`\n\nThis clicks on element "${elementId}".` } ] }; }
- Input schema for the 'mqscript_element_click' tool, defining the required 'elementId' parameter.inputSchema: { type: 'object' as const, properties: { elementId: { type: 'string', description: 'Element ID or selector' } }, required: ['elementId'] },
- src/index.ts:32-61 (registration)The tool is registered by spreading ElementCommands into the ALL_TOOLS object, which is used by the MCP server's ListTools and CallTool handlers.const ALL_TOOLS = { // Basic Commands - 基础命令 ...TouchCommands, ...ControlCommands, ...ColorCommands, ...OtherCommands, // Standard Library - 标准库函数 ...MathFunctions, ...StringFunctions, ...TypeConversionFunctions, ...ArrayFunctions, // UI Commands - 界面命令 ...UIControlCommands, ...UIPropertyCommands, ...FloatingWindowCommands, // Extension Commands - 扩展命令 ...ElementCommands, ...DeviceCommands, ...PhoneCommands, ...SysCommands, // Plugin Commands - 插件命令 ...CJsonCommands, ...DateTimeCommands, ...FileCommands, ...TuringCommands, };