Skip to main content

Hover-the-Mouse-over-the-Text

Command Description

Search by rules containing Interface Element with specified strings and puts Move the mouse to this Interface Element, the mouse is locked in the text location

Command Prototype

Text.Hover(objUiElement,sText,iRule,iOccurrence,iTimeOut,optionArgs)

Parameter Description

ParameterRequiredTypeDefaultDescription
objUiElementTruedecorator@ui""To find the parent element of the text, the program conducts "find text" within this element. When the property is passed as a string, the child element is looked up as a feature string. When the property is passed as an UiElement, the lookup is directly done in the UiElement. When the property is passed as null, the lookup is done in all windows
sTextTruestring""The text used for finding elements
iRuleTrueenum"instr"The rule used for finding text
iOccurrenceTruenumber1If the string in the Text field appears multiple times in the indicated UI element, specify the number of occurrences to click, for example, if the string appears 4 times and you want to click the first match, please Write 1 in this field
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)

Demo

TracePrint("--------------------------Mouse over text---------------- -------------") 
//-------------------------------------------------------------------------------
//[Remarks] Search for the interface element containing the specified string according to the rules and move the mouse to this interface element, the mouse stay position is the found text position
//Input parameter 1:
// objUiElement--Identifies the target. Note: If you need to find the parent element of the text, the program will search for the text operation in this element. When the attribute is passed as string type, it will search for the interface element as a feature string and then search for child elements. When the attribute is passed as UiElement type , lookup directly in this UiElement element, if passed as null, lookup in all windows
// sText--The text that needs to be found in the target. Note: Text to use when finding elements
// iRule--find rules. Note: Rules to use when looking for text
// iOccurrence--similar result location. Note: If the string in the Text field appears multiple times in the indicated interface element, specify the number of occurrences to click here. For example, if the string appears 4 times and you want to click on the first occurrence, write 1 in this field
// iTimeOut--timeout time (milliseconds). Note: Specifies the time (in milliseconds) to wait to retry to find screen extents before throwing an error. Default 30000 milliseconds (30 seconds)
// optionArgs--Optional parameters. Note: This parameter is a number of optional parameters, including error continue execution, delay after execution, delay before execution, activation window, cursor position, abscissa offset, ordinate offset, auxiliary keys, operation type
//out parameters:
// None
//
//Command Prototype:Text.Hover(objUiElement,sText,iRule,iOccurrence,iTimeOut,optionArgs)
Text.Hover(@ui"text<span>_mouse over text","text","instr",1,10000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200, "bSetForeground":true,"sCursorPosition":"Center","iCursorOffsetX":10,"iCursorOffsetY":10,"sKeyModifiers":[],"sSimulate":"simulate"})