Casting

Capture Visible Tab

Capture visible tab screenshot.

Capture visible tab screenshot.

Takes a screenshot of the currently visible browser tab (optionally within a specified window) in PNG format and returns it as a base64 data URL to the native application.

Examples

GPAL Fluent: High-level fluent C# API

GPAL.CaptureScreen(browser).SaveToFile(screenCapFile); // capture browser tab GPAL.CaptureScreen(null).SaveToFile(screenCapFile); // capture screen

MagicHelper: MagicHelper utility library

GPAL.MagicHelper.CaptureVisibleTab();

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.CaptureVisibleTab(ImageFormat.PNG).Execute();

Puppeteer Communicator: Low-level communicator

await browser.PuppeteerCommunicator.CaptureVisibleTab(string sessionId);

REST Client: Direct REST/HTTP client

//'windowId' is an optional parameter to specify which window is to be captured. If no 'windowId' is provided, the capture will be taken of the currently active window.

GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.CaptureVisibleTab).Execute(); GPAL.OttoMagicClient.WithEndpoint(ApiEndpoint.CaptureVisibleTab).WithWindowId(int windowId).Execute();