Skip to main content

saveScreenshot

Takes a screenshot in PNG format.

Fields

FieldTypeDescriptionDefault
idstringOptional. ID of the step.Generated UUID
descriptionstringOptional. Description of the step.
actionstringRequired. The action to perform.
pathstringOptional. File path of the PNG file, relative to directory. If not specified, the file name is the ID of the step.
directorystringOptional. Directory of the PNG file. If the directory doesn't exist, creates the directory.
maxVariationnumberOptional. Allowed variation in percentage of pixels between the new screenshot and the existing screenshot at path. If the difference between the new screenshot and the existing screenshot is greater than maxVariation, the step fails. If a screenshot doesn't exist at path, the system ignores this value.5
overwritestringOptional. If true, overwrites the existing screenshot at path if it exists.
If byVariation, overwrites the existing screenshot at path if the difference between the new screenshot and the existing screenshot is greater than maxVariation.

Accepted values: true, false, byVariation
false

Examples

{
"action": "saveScreenshot"
}
{
"action": "saveScreenshot",
"path": "results.png"
}
{
"action": "saveScreenshot",
"path": "results.png",
"directory": "static/images"
}
{
"action": "saveScreenshot",
"path": "results.png",
"directory": "static/images",
"maxVariation": 10,
"overwrite": "byVariation"
}