Interaction

Scroll Into View

Scrolls a specified web element into view.

Scrolls a specified web element into view.

Scrolls the page so that the specified web element becomes visible and is positioned near the center of the viewport. GPAL utilizes a smart scroll; if the element is already visible on-screen (possibly due to another element scrolling into view) then no scrolling occurs until the element requested is not displayed.

Examples

MagicHelper: MagicHelper utility library

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

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.ScrollIntoView(string css).Execute(); browser.PuppeteerClient.ScrollIntoView(string xpath).Execute();

Puppeteer Communicator: Low-level communicator

//PuppeteerCommunicator's ScrollIntoView takes a resolved backendNodeId (or GPALElement) rather than a raw CSS/XPath selector.

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

REST Client: Direct REST/HTTP client

GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.ScrollIntoView).WithCss(string css).Execute(); GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.ScrollIntoView).WithXpath(string xpath).Execute();