Element Info & Attributes

Get Shadow Root

Serialize an element's shadow root with locators and metadata.

Serialize an element's shadow root with locators and metadata.

Returns a GPALElement of the element's parent in JSON format including attributes, geometry, visibility state, identifiers, multiple locator strategies (XPath and CSS), and key properties such as text, value, and source URLs. The function enriches the element with positional data, bounding box metrics, and alternative selectors for robust identification, then returns the serialized result as a JSON string.

TIP

CSSAttributes, DOMAttributes and DomProperties are lazy loaded on first usage.

Examples

MagicHelper: MagicHelper utility library

GPAL.MagicHelper.GetShadowRoot("#shadow-host");

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.GetShadowRoot("#shadow-host").Execute<GPALElement>();

Puppeteer Communicator: Low-level communicator

await browser.PuppeteerCommunicator.GetShadowRoot("#shadow-host");

REST Client: Direct REST/HTTP client

GPAL.OttoMagicClient.GetShadowRoot("#shadow-host").Execute<GPALElement>();