[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 Type | Required | Description |
---|---|---|---|
windowsObject | WindowsTestObject | Yes | An object that describes locator and locator strategy to find Windows Element. |
Returns
Parameter Type | Description |
---|---|
Rectangle | Rectangle indicating the element's bounding rectangle. |
StepFailedException | Throws 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())