Class TakeAndSaveScreenshotBuilder
- Namespace
- CSF.Screenplay.Selenium.Builders
- Assembly
- CSF.Screenplay.Selenium.dll
A builder class to create an instance of TakeAndSaveScreenshot.
public class TakeAndSaveScreenshotBuilder : IGetsPerformable
- Inheritance
-
TakeAndSaveScreenshotBuilder
- Implements
- Inherited Members
Remarks
Like all builders in this namespace, this class is not to be instantiated directly. Instead, use either of the TakeAndSaveAScreenshot() or TakeAndSaveAScreenshotIfSupported() methods.
Methods
WithTheFormat(ScreenshotImageFormat)
Specifies the image format to use when saving the screenshot.
public TakeAndSaveScreenshotBuilder WithTheFormat(ScreenshotImageFormat format)
Parameters
formatScreenshotImageFormatThe file format
Returns
- TakeAndSaveScreenshotBuilder
This same builder, so further customisations may be performed
Remarks
If the image format is omitted (this method is not used) then the saved screenshot will default to the Png image format.
WithTheName(string)
Specifies a human-readable name/summary for the screenshot.
public TakeAndSaveScreenshotBuilder WithTheName(string name)
Parameters
namestringA human-readable name for the screenshot.
Returns
- TakeAndSaveScreenshotBuilder
This same builder, so further customisations may be performed
Remarks
Specifying this name is recommended, as it will form a part of the report which is subsequently generated. The name will serve to identify the screenshot amongst other assets which may be included in the report. The name will also be used as part of the filename by which the screenshot asset file is saved.
Operators
implicit operator TakeAndSaveScreenshot(TakeAndSaveScreenshotBuilder)
Implicitly converts a SaveScreenshotBuilder to an SaveScreenshot.
public static implicit operator TakeAndSaveScreenshot(TakeAndSaveScreenshotBuilder builder)
Parameters
builderTakeAndSaveScreenshotBuilderThe SaveScreenshotBuilder instance.
Returns
- TakeAndSaveScreenshot
An SaveScreenshot instance.