Wait-for-Element
Command Description
Wait for element display or disappear
Command Prototype
UiElement.Wait(objUiElement,iType,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 |
iType | True | enum | "show" | Whether to wait for the element to show or to disappear |
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 |
Demo
TracePrint "--------------------Wait for element--------------------"
// --------------------------------------------------------
// [Remarks] Waiting for the element, 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:
// iType--waiting mode
// Input parameter 3:
// iTimeOut--timeout time. Default unit: milliseconds. Type: Int
// Input parameter 4:
// optionArgs--optional parameters (including: error continue execution/delay after execution/delay before execution).Type:Dict
// : UiElement.Wait (objUiElement, iType, iTimeOut, optionArgs)
// --------------------------------------------------------
UiElement.Wait(@ui"table element<td>_username1","show",10000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200})