Element Info & Attributes

Get Parent Node

Serialize an element's parent with locators and metadata.

Serialize an element's parent 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.GetParentNode(string css); GPAL.MagicHelper.GetParentNode(string xpath);

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.GetParentNode(string css).Execute<GPALElement>();

Puppeteer Communicator: Low-level communicator

//At this layer, elementId is the already-resolved element identifier rather than a CSS/XPath selector.

await browser.PuppeteerCommunicator.GetParentNode(string elementId, string sessionId);

REST Client: Direct REST/HTTP client

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