Click-Target
Command Description
Click the specified interface element
Command Prototype
Mouse.Action(objUiElement,iButton,iType,iTimeOut,optionArgs)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
objUiElement | True | decorator | @ui"" | When the attribute is transferred as a string, it is used as the characteristic string to find the interface element. When the attribute is transferred as UiElement, directly click on the corresponding interface element |
iButton | True | enum | "left" | Mouse button {left: Left button, right: Right button, middle: Middle button} |
iType | True | enum | "click" | Click type {click: single click, dbclick: double click, down: keydown, up: keyup} |
iTimeOut | True | number | 10000 | Specify the amount of time (in milliseconds) that wait for the event to run before selectorNotFoundException to trigger an error (in milliseconds) The default value is 10,000 ms (10 seconds) |
bContinueOnError | None | boolean | None | Specify whether the automation should continue to support this field even if the activity is incorrect, it is only supported by the Boolean value (true, false) default value |
iDelayAfter | None | number | 300 | Delay time (in milliseconds) after executing the activity is 300 milliseconds |
iDelayBefore | None | number | 200 | The delay time (in milliseconds) before any operations are executed is by default 200 milliseconds |
bSetForeground | None | boolean | True | Whether to activate the target window before executing |
sCursorPosition | None | enum | "Center" | Describes the cursor start point for adding offsets for the offsetx and offsety properties. The following options are available: topleft, topright, bottomleft, bottomlight, and center. The default option is center |
iCursorOffsetX | None | number | None | The horizontal movement of the cursor based on the option in the "Position" field |
iCursorOffsetY | None | number | None | The vertical offset of the cursor position based on the option selected in the "Position" field |
sKeyModifiers | None | set | [] | Keyboard keys used while a mouse action is triggered: Alt, Ctrl, Shift, Win |
sSimulate | None | enum | simulate | Available operation types are: Background Operation (uia), Simulated Operation (simulate), System Message(message). Default: Simulated Operation (simulate) |
bMoveSmoothly | None | boolean | None | Whether to scroll horizontally |
Demo
TracePrint "--------------------Click the mouse--------------------"
// --------------------------------------------------------
// [Remarks] Click the mouse, the Demo needs to open the IE browser to jump to the Baidu homepage
// Input parameter 1:
// objUiElement--target element, click the "Baidu click" button, the user can re-record the element according to the actual scene
// Input parameter 2:
// iButton--mouse click (left/right/middle)
// Input parameter 3:
// iType--click type (click / double click / press / pop up)
// Input parameter 4:
// iTimeOut--timeout time. Default unit: milliseconds. Type: Int
// Input parameter 5:
// optionArgs--optional parameters (including: error continue execution/delay after execution/delay before execution/activation window/cursor position/abscissa offset/ordinate offset/assistant key/operation Type/smooth move).Type:Dict
// : Mouse.Action (objUiElement, iButton, iType, iTimeOut, optionArgs)
// --------------------------------------------------------
Mouse.Action(@ui"Input control<input>_ Baidu once 6","left","click",10000,{"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200, "bSetForeground": true, "sCursorPosition": "Center", "iCursorOffsetX": 0, "iCursorOffsetY": 0, "sKeyModifiers": [],"sSimulate": "simulate", "bMoveSmoothly": false})