Table of Contents generated with DocToc
author: kazurayam
This is a Katalon Studio project for demonstration purpose. You can clone this out to your PC and run it with your Katalon Studio.
This project was initially developed using Katalon Studio 5.7.0, and has proved to work with the higher versions.
This project demonstrates how to perform screenshot-comparison testings in Katalon Studio.
If my AUT has 100 pages and if I do it manually, it would take me more than 1 hour to go through a Twins test. It's too tiring, too boring. I don't like doing such slavery labour! Therefore I would add the final term:
And let be add some more terms:
Preliminary study revealed 2 technical problems.
This project demonstrates how to take multiple sets of web page screen shots and store them into a well-structured file system tree. This demo project uses another GitHub repository:
As for the full-page screenshot problem, I found that the library:
This library solves the problem like a charm. I wrote a report how I utilized aShot in Katalon Studio:Entire page screenshot by aShot in Katalon Studio
I have integrated those external resources to build a tool set for Visual Testing in Katalon Studio.
Tests Explorer
pane, click Test Suites/CURA
Now you open and run a Test Suite Collection named "Test Suites/CURA/Execute_twins
".
The Test Suite Collection Executes_twins
takes screenshots of a pair of URLs:
For example, the test may capture screenshots as follows.
<projectDir>/Materials/Main.TS1/20180920_165543/Main.Basic/CURA_Homepage.png
This test generates a report at <projectDir>/Materials/index.html
where you will find screenshot-comparison result.
You can see an example output in action uploaded public : http://vtprojects.kazurayam.com/VisualTestingInKatalonStudio/Materials/index.html
Please find the html using Windows Explorer or Mac Finder. Unfortunately Katalon Studio GUI does not let us see the Materials/index.html. Open the html with your favorite web browser. You should bookmark it.
The Materials/index.html would show a list of source images plus the images as comparison result.
If you click the line with purple background color, you will see a ImageDiff with a lot of red-portion. The red portion shows the differences between the two source images.
File path: <projectDir>/Materials/ImageDiff/yyyyMMdd_hhmmss/ImageDiff/CURA_Homepage.yyyyMMdd_hhmmss_product-yyyyMMdd_hhmmss_develop.(6.30)FAILED.png
The area painted red indicates that the pair of screenshots of 2 hosts are different. This tool does not tell you why. It just lets you know of the difference. You, as a developer, should be able to investigate the reason of the difference.
The example provides one more interesting script named Test Suites/CURA/Execute_chronos
.
Execute_chronos
takes screenshots of a single URL:
and compares it to another set of screenshots of the same URL taken previously. It can compare the current set of screenshot to another set proviously taken. You can choose one of the following:
you can see how these STRATEGIES are implemented in Test Cases/VT/restorePreviousTSuiteResult
The output of Execute_chronos
is just similar to the one created by Execute_twins
. Please find <projectDir>/Materials/index.html
.
As of v1.12.0, the Modal dialog presents 2 pane in a carousel format. The first pane shows Expected image on the left, Actual image on the right. And another pane shows the Diff image. You can switch between the 2 panes by a single mouse click on . This format makes it easy to locate and see the visual differences in the Expected-Actual images.
Are you interested in this? Do you want to do similar screenshot-comparison testing against your own Application Under Test in your own Katalon Studio project?
The following page describes how to import Test Suites/CURA/Execute_twins
and Test Suites/CURA/Execute_chrones
into your own Katalon Studio project:
You can make a copy of "CURA" resources and rename them to your own AUT symbol. You want to modify the code as you want to accomplish your own Visual Testing. The following page describe how to getting started with customization.
see Revision History
see Groovydoc