Move-over-Target
Command Description
Move the cursor to the specified interface element
Command Prototype
Mouse.Hover(objUiElement,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 |
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 | 10 | The horizontal movement of the cursor based on the option in the "Position" field |
iCursorOffsetY | None | number | 10 | 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 "--------------------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})