Skip to main content


Command Description

Get the area of an element and return a rectangle object containing the element's position

Command Prototype

objRect = UiElement.GetRect(objUiElement,sRelative,optionArgs)

Parameter Description

objUiElementTruedecorator@ui""Feature string of elements
sRelativeTrueenum"parent"The coordinate that the returned element's position is relative to
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


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


TracePrint "--------------------Get element area--------------------" 
// --------------------------------------------------------
// [Remarks] To get the element area, the Demo needs to use IE to open the URL below
// url:
// Input parameter 1:
// objUiElement--target element
// Input parameter 2:
// sRelative--relative position
// Input parameter 3:
// optionArgs--optional parameters (including: error continue execution/delay after execution/delay before execution).Type:Dict

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

// Command prototype: objRect = UiElement.GetRect(objUiElement,sRelative,optionArgs)
// --------------------------------------------------------

objRect = UiElement.GetRect(@ui"table element <td>_self-evaluation","parent",{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200})