Table of Contents

Class Screenshot

Namespace
OpenQA.Selenium
Assembly
WebDriver.dll

Represents an image of the page currently loaded in the browser.

public class Screenshot
Inheritance
Screenshot
Inherited Members

Constructors

Screenshot(string)

Initializes a new instance of the Screenshot class.

public Screenshot(string base64EncodedScreenshot)

Parameters

base64EncodedScreenshot string

The image of the page as a Base64-encoded string.

Properties

AsBase64EncodedString

Gets the value of the screenshot image as a Base64-encoded string.

public string AsBase64EncodedString { get; }

Property Value

string

AsByteArray

Gets the value of the screenshot image as an array of bytes.

public byte[] AsByteArray { get; }

Property Value

byte[]

Methods

SaveAsFile(string, ImageFormat)

Saves the screenshot to a file, overwriting the file if it already exists.

public void SaveAsFile(string fileName, ImageFormat format)

Parameters

fileName string

The full path and file name to save the screenshot to.

format ImageFormat

A System.Drawing.Imaging.ImageFormat object indicating the format to save the image to.

ToString()

Returns a String that represents the current Object.

public override string ToString()

Returns

string

A String that represents the current Object.