With Katalon Studio, you can capture screenshots during test execution.
Capturing screenshots helps you identify the problem when a test fails. By doing so, you can debug the test script more effectively and quickly.
By default, Katalon Studio captures screenshots automatically upon test failures. This feature is currently applicable to Web UI and Mobile testing.
When a test suite fails, you can either open a test suite's report or go to a test suite's Result tab for captured screenshots.
To view the captured screenshots in a test suite's Results tab, follow these steps:
Select the failed Test Suite.
Open its Result tab.
Select a failed test case.
Click Show Test Case Details on the top right corner.
The Test Case's Log then appears.
Click on the Image tab.
To view the captured screenshots in a test suite's report, click Export report and select the file type (HTML, CSV or PDF), then open the exported file for viewing.
You can also use the captured screenshots for visual testing with TestOps Vision. See: Visual Testing.
To turn off the default settings, do as follows:
For version 7.8 onwards:
Go to Project > Settings > Execution. In the displayed During-Execution Options panel, uncheck Take Screenshot when execution failed, and click Apply and Close.
For versions before 7.8:
Go to Project > Settings > Report. In the displayed Report view, uncheck Take Screenshot when execution failed, and click OK.
Configure screenshots manually
If you wish to manually set the conditions for capturing screenshots during tests, you can use the following built-in keywords for Web UI and Mobile testing:
- [WebUI] Take Screenshot
- [WebUI] Take Screenshot As Checkpoint (Available from 7.7)
- [WebUI] Take Area Screenshot As Checkpoint (Available from 7.7)
- [WebUI] Take Area Screenshot (Available from 7.7)
- [WebUI] Take Element Screenshot As Checkpoint (Available from 7.7)
- [WebUI] Take Element Screenshot (Available from 7.7)
- [WebUI] Take Full Page Screenshot As Checkpoint (Available from 7.7)
- [WebUI] Take Full Page Screenshot (Available from 7.7)
- [Mobile] Take Screenshot
Configure screenshots in Manual mode in Katalon Studio
If you are not familiar with coding in Script mode, you can also insert built-in keywords in Manual mode.
Follow these steps:
Open Katalon Studio and go to your Project.
Select a Test Case in Manual mode.
The Test Case shows all Test steps.
Double click on a Test step and choose options (as shown in the picture below).
You have added a new Test step in Manual mode.
Double click on the new Test step, and enter the keyword.
A list of built-in keywords for capturing screenshots displays as below.
Select a built-in keyword (e.g., Take Full Page Screenshot As Checkpoint).
You have inserted the built-in keyword.
Double click on the Input section of the newly-added keyword to insert a value.
The Input box appears as below.
Insert a value for the keyword (e.g., Sample Visual Test), then click OK.