Skip to main content

[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 TypeRequiredDescription
checkpointNameStringYesRepresents the name of the image on TestOps Vision. On a local machine, this name will be appended with TestOps Vision prefix (keyes-).
toTestObjectYesRepresents the element you want to take screenshot.
flowControlFailureHandlingOptionalSpecify

failure handling

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 Test Object > UI > logo 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 header for TestOps Vision. Set the checkpointName to header:
    import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

    // where ignoredElements is a user-defined List-typed variable.
    WebUI.takeElementScreenshotAsCheckpoint('header', header)
Was this page helpful?