[WebUI] Take Element Screenshot as Checkpoint
Description
Take a screenshot of a specific web element to send to TestOps Vision. The captured image will be saved in .png format and stored in the keyes folder in the report folder.
Keyword name: takeElementScreenshotAsCheckpoint
Parameters
| Parameter | Parameter Type | Required | Description |
|---|---|---|---|
| checkpointName | String | Yes | Represents the name of the image on TestOps Vision. On a local machine, this name will be appended with TestOps Vision prefix (keyes-). |
| to | TestObject | Yes | Represents the element you want to take screenshot. |
| flowControl | FailureHandling | Optional | Specify schema to determine whether the execution should be allowed to continue or stop. |
Example
- You want to take a screenshot of an element that you have captured by using Katalon Spy Utility and stored in for TestOps Vision. The checkpoint's name is
logo. Default failure handling is used:import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
WebUI.takeElementScreenshotAsCheckpoint('logo', findTestObject('UI/logo')) - You want to take a screenshot of a Test Object stored in a variable named
headerfor TestOps Vision. Set thecheckpointNametoheader:import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
// where ignoredElements is a user-defined List-typed variable.
WebUI.takeElementScreenshotAsCheckpoint('header', header)