Element Info & Attributes

Element From Point

Asks the page what is at a viewport coordinate and answers whether that is the element in question, or something inside it. This is how a click checks itself before it is delivered: an element can be scrolled, covered by a banner, or sitting under an overlay, and in all three cases the coordinates still look reasonable while the click would land on something else. Mandatory parameters: x and y. One of css, elementId, or gpalElements identifies the element that should receive the click.

NOTE

Viewport coordinates, in CSS pixels, not document coordinates and not screen coordinates.

Examples

GPAL Fluent: High-level fluent C# API

//A hardware click has no way to know what it hit, so GPAL asks the page first and reports a click that would have missed rather than delivering it.

// Used internally before a hardware click. Nothing to call.

MagicHelper: MagicHelper utility library

bool wouldHit = browser.MagicHelper.ElementFromPoint("element123", 420, 315);

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.ElementFromPoint(string elementId, int x, int y).Execute<bool>();

Puppeteer Communicator: Low-level communicator

await browser.PuppeteerCommunicator.ElementFromPoint(GPALElement element, int x, int y, string sessionId);

REST Client: Direct REST/HTTP client

browser.OttoMagicClient.WithEndpoint(ApiEndpoint.ElementFromPoint).WithElementId(string elementId).WithParameters(new { x, y }).Execute<bool>();

💬 Ask GPAL