Using the attribute "waelementrectangle" we can extract the position and dimensions of any web element.



The above Action will return a text value in the form of "a, b, c, d".


a, b -> coordinates of the top left corner of the element, relative to the top left corner of the HTML page*.

c -> width

d -> height


*Note that the top left corner of the HTML page is different than the top left corner of the browser.

In order to find the coordinates of the top left corner of the HTML page, you can use the Web Browser's Instance properties DisplayRectangleX and DisplayRectangleY.

For example, after storing a browser's instance into the variable %Browser%, then %Browser.DisplayRectangleX% will return the X dimension and %Browser.DisplayRectangleY% the Y dimension, of the top left corner of the HTML page.


Additionally, note that the coordinates of the center of a web element can be retrieved using the "waelementcentercoords" attribute.