Skip to main content

Get-Text

Command Description

Get the text content of the specified interface element

Command Prototype

sRet = Text.Get(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 operate 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

return

sRet,The variable used to save the output of the command.

Demo

TracePrint("--------------------------Get text------------------- --------") 
//-------------------------------------------------------------------------------
//[Remarks] Get the text content of the specified interface element
//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 null, lookup in all windows
// iTimeOut--timeout time (milliseconds). Note: Specifies the time (in milliseconds) to wait to retry the find screen extent 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, post-execution delay, pre-execution delay, activation window
//out parameters:
// sRet--The variable to which the output of the function call is saved.
//
//Command prototype: sRet = Text.Get(objUiElement,iTimeOut,optionArgs)
sRet = Text.Get(@ui"Block-level element <div>_Get Get text command description Get the text content of the specified interface element Command prototype PlainText auto-change",10000,{"bContinueOnError":false,"iDelayAfter":300 ,"iDelayBefore":200,"bSetForeground":true})
TracePrint (sRet)