Skip to main content

Get-Element-Attribute

Command Description

Get attributes of an element

Command Prototype

sRet = UiElement.GetAttribute(objUiElement,sAttribute,optionArgs)

Parameter Description

ParameterRequiredTypeDefaultDescription
objUiElementTruedecorator@ui""Feature string of elements
sAttributeTruestring""The name of the attribute to get
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

return

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

Demo

TracePrint "--------------------Get element attribute--------------------" 
// --------------------------------------------------------
// [Remarks] To get element attributes, the Demo needs to use IE to open the URL below
// url: http://www.vrbrothers.com/cn/wqm/demo/pages/Demo-ComplexForm.aspx
// Input parameter 1:
// objUiElement--target element
// Input parameter 2:
// sAttribute-- contains elements
// Input parameter 3:
// optionArgs--optional parameters (including: error continue execution/delay after execution/delay before execution).Type:Dict

// Output parameters:
// sRet--The variable to which the output of the function call is saved

// : sRet = UiElement.GetAttribute (objUiElement, sAttribute, optionArgs)
// --------------------------------------------------------

sRet = UiElement.GetAttribute(@ui"Input Controls<input>6","type",{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200})
TracePrint (sRet)