Navigation

Get Bounding Client Rectangle

Get element bounding box.

Get element bounding box.

Retrieves the elements position and size relative to the viewport using getBoundingClientRect() and returns the result as a JSON string containing the rectangles coordinates and dimensions.

Examples

GPAL Fluent: High-level fluent C# API

ClientRectangle boundingRect = gPalElement.BoundingRect;

MagicHelper: MagicHelper utility library

GPAL.MagicHelper.GetBoundingClientRect(string css); GPAL.MagicHelper.GetBoundingClientRect(string xpath);

Puppeteer Client: Puppeteer-style C# client

//PuppeteerClient.GetBoundingClientRect takes a resolved backendNodeId, not a raw CSS/XPath selector.

browser.PuppeteerClient.GetBoundingClientRect(string backendNodeId).Execute();

Puppeteer Communicator: Low-level communicator

await browser.PuppeteerCommunicator.GetBoundingClientRect(int backendNodeId, string sessionId);

REST Client: Direct REST/HTTP client

GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.GetBoundingClientRect).WithCss(string css).Execute(); GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.GetBoundingClientRect).WithXPath(string xpath).Execute();