Skip to main content

Move-over-Target

Command Description

Move the cursor to the specified interface element

Command Prototype

Mouse.Hover(objUiElement,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
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
iCursorOffsetXNonenumber10The horizontal movement of the cursor based on the option in the "Position" field
iCursorOffsetYNonenumber10The 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
sSimulateNoneenum"simulate"Available operation types are: Background Operation (uia), Simulated Operation (simulate), System Message(message). Default: Simulated Operation (simulate)
bMoveSmoothlyNonebooleanNoneWhether to scroll horizontally

Demo

TracePrint "--------------------move to target--------------------" 
// --------------------------------------------------------
// [Remarks] Move to the target, the Demo needs to open the IE browser and jump to the Baidu homepage
// Input parameter 1:
// objUiElement--target element, move to the "Baidu click" button, the user can re-record the element according to the actual scene
// Input parameter 2:
// iTimeOut--timeout time. Default unit: milliseconds. Type: Int
// Input parameter 3:
// 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

// Command prototype: Mouse.Hover(objUiElement,iTimeOut,optionArgs)
// --------------------------------------------------------

Mouse.Hover(@ui"Input control<input>_Baidu Yiyi 7",10000,{"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200, "bSetForeground": true, "sCursorPosition": "Center", "iCursorOffsetX": 10, "iCursorOffsetY": 10, "sKeyModifiers": [],"sSimulate": "simulate", "bMoveSmoothly" : false})