ScreenshotSaveAsFile Method (String, ImageFormat)WebDriver

Note: This API is now obsolete.

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

Namespace: OpenQA.Selenium
Assembly: WebDriver (in WebDriver.dll) Version: 3.1.0
Syntax

[ObsoleteAttribute("System.Drawing.Imaging.ImageFormat is not supported in .NET Core, and depending on it is being removed from WebDriver. Please convert to ScreenshotImageFormat.")]
public void SaveAsFile(
	string fileName,
	ImageFormat format
)

Parameters

fileName
Type: SystemString
The full path and file name to save the screenshot to.
format
Type: System.Drawing.ImagingImageFormat
A ImageFormat object indicating the format to save the image to.
See Also

Reference