getElementRect
Retrieves element's coordinates relative to viewport and it's dimensions. Learn more about how it's retrieved in getBoundingClientRect.
getElementRect(elemId)
#
ParameterselemId
: The target element
#
Returns- A
map
having key value pairs of:x
: Position of element on x axis inpixels
y
: Position of element on y axis inpixels
width
: Width of element inpixels
height
: Height of element inpixels
Example:
rect = getElementRect(findElement('description', by.desc))# rect is {x: 800, y: 2000, width: 600, height: 200}