Interaction

Hide Element

Hide an element.

Hide an element.

Sets the elements CSS display property to none, removing it from the page layout and making it invisible without deleting it from the DOM.

Examples

GPAL Fluent: High-level fluent C# API

//Both forms set the element's CSS display to none. The fluent Browser.Hide(selector) form hides every element matching the current/given selector(s); GPALElement.Hide() hides a single already-resolved element.

browser.WithSelector(selector).Hide(); gpalElement.Hide();

MagicHelper: MagicHelper utility library

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

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.HideElement(string css).Execute();

Puppeteer Communicator: Low-level communicator

//At this layer, backendNodeId is the already-resolved element identifier rather than a CSS/XPath selector. Use gPalElement.ElementBackendNodeId

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

REST Client: Direct REST/HTTP client

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