Get-ElementRectangle

Gets the bounds of an element.

Powershell

Gets the bounds of an element. Returns: a rectangle reprenting the outer bounds of an element.

Syntax

Get-ElementRectangle [-sessionId ] [-elementId] []

Parameters

name description
sessionId (Optional) The identifier of the session to route the command to.
elementId The identifier of the element to query.

Examples

Find-Element "login" | Get-ElementRectangle

C#

Declaration

System.Drawing.Size OpenQA.Selenium.IWebElement.Size; System.Drawing.Point OpenQA.Selenium.IWebElement.Location;

Returns:

type description
System.Drawing.Size The element size
System.Drawing.Point The element location

Examples

element.Size
element.Location