Skip to main content

[Windows] Get Element Rectangle

Description​

Get the bounding rectangle of the WebElement that is found by using locator value of the given windowsObject.

Keyword name: getElementRect

Parameters​

Parameter Parameter TypeRequiredDescription
windowsObjectWindowsTestObjectYesAn object that describes locator and locator strategy to find Windows Element.

Returns​

Parameter TypeDescription
RectangleRectangle indicating the element's bounding rectangle.
StepFailedExceptionThrows an error if Katalon Studio cannot find the specified element.

Example​

import org.openqa.selenium.Rectangle as Rectangle
Rectangle rect = Windows.getElementRect(findWindowsObject('Object Repository/Notepad/Edit'))
println String.format("{ x: %d, y: %d, width: %d, height: %d }", rect.getX(), rect.getY(), rect.getWidth(), rect.getHeight())
Was this page helpful?