Set-Element-Attribute
Command Description
Set element attributes
Command Prototype
UiElement.SetAttribute(objUiElement,sAttribute,sValue,optionArgs)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
objUiElement | True | decorator | @ui"" | Feature string of elements |
sAttribute | True | string | "" | The name of the attribute to modify |
sValue | True | string | "" | The attribute value to modify |
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 |
Demo
TracePrint "--------------------Set Element Properties--------------------"
// --------------------------------------------------------
// [Remarks] To set element properties, 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--Attribute name
// Input parameter 3:
// sValue--attribute value
// Input parameter 4:
// optionArgs--optional parameters (including: error continue execution/delay after execution/delay before execution).Type:Dict
// Command prototype: UiElement.SetAttribute(objUiElement,sAttribute,sValue,optionArgs)
// --------------------------------------------------------
UiElement.SetAttribute(@ui"Input Controls<input>7","type","test",{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200})