Table of Contents

Class Screenshot

Namespace
OpenQA.Selenium
Assembly
WebDriver.dll

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

[Serializable]
public class Screenshot : EncodedFile
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.

Exceptions

ArgumentNullException

If base64EncodedScreenshot is null.

FormatException

The length of base64EncodedScreenshot, ignoring white-space characters, is not zero or a multiple of 4.

-or-

The format of base64EncodedScreenshot is invalid. base64EncodedScreenshot contains a non-base-64 character, more than two padding characters, or a non-white space-character among the padding characters.

Methods

SaveAsFile(string)

Saves the screenshot to a Portable Network Graphics (PNG) file, overwriting the file if it already exists.

public override void SaveAsFile(string fileName)

Parameters

fileName string

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