Skip to main content

Click-Target

Command Description

Click the specified interface element

Command Prototype

Mouse.Action(objUiElement,iButton,iType,iTimeOut,optionArgs)

Parameter Description

ParameterRequiredTypeDefaultDescription
objUiElementTruedecorator@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
iButtonTrueenum"left"Mouse button {left: Left button, right: Right button, middle: Middle button}
iTypeTrueenum"click"Click type {click: single click, dbclick: double click, down: keydown, up: keyup}
iTimeOutTruenumber10000Specify 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)
bContinueOnErrorNonebooleanNoneSpecify 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
iDelayAfterNonenumber300Delay time (in milliseconds) after executing the activity is 300 milliseconds
iDelayBeforeNonenumber200The delay time (in milliseconds) before any operations are executed is by default 200 milliseconds
bSetForegroundNonebooleanTrueWhether to activate the target window before executing
sCursorPositionNoneenum"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
iCursorOffsetXNonenumberNoneThe horizontal movement of the cursor based on the option in the "Position" field
iCursorOffsetYNonenumberNoneThe vertical offset of the cursor position based on the option selected in the "Position" field
sKeyModifiersNoneset[]Keyboard keys used while a mouse action is triggered: Alt, Ctrl, Shift, Win
sSimulateNoneenumsimulateAvailable operation types are: Background Operation (uia), Simulated Operation (simulate), System Message(message). Default: Simulated Operation (simulate)
bMoveSmoothlyNonebooleanNoneWhether 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})