I have made a demo project on GitHub and published it:
last edited at 1 Jan, 2021
Problem to solve
In the Katalon User Forum, there was a question that asked how to automatically copy the Test Reports in HTML/PDF format to another location once a test suite finished.
In response to the question, I replied with a post where I described my previous solution. To be honest, I am not very much happy with my previous solution.
Russ Thomas replied a post where he mentioned that, instead of bothering around the built-in Reports, he developed his own reporting functionality. In that post, Russ did not described how his code looks like. So, I was concerned that the readers may feel lost where to go for developing custom reports as Russ did.
Katalon Studio provides TestListener which is annotated with the
If you make full use of the TestListener feature, you can compile your own reports of test execution with full control over contents/location/timing. You can compile report in any format you like. You can save the file wherever you want.
How to run the demo
open the Test Suite
Test Suites/TS1 , and just run it.
If you look at the console log, you can find output like this:
@AfterTestSuite Reports/20210101_133234/TS1/20210101_133234/execution0.log 30098bytes Reports/20210101_133234/TS1/20210101_133234/execution0.log.lck 0bytes Reports/20210101_133234/TS1/20210101_133234/execution.properties 2660bytes Reports/20210101_133234/TS1/20210101_133234/testCaseBinding 128bytes
This message proves that 2 files in the Report folder (
execution0.log ) are available at the event of
@AfterTestSuite . In these 2 files you can find almost all information out of Katalon Studio how the test suite was configured and how it ran.
Test Suites/TS1 finished, a new folder
<projectDir>/CustomReport will be created. Inside it you will find a 2 files.
CustomReport/memo_TS1.json file contains information from:
- TestSuiteContext object
- TestCaseContext objects
- execution.properties file
execution0.log file is copied from the Reports folder just to for reference. In the log file you can find all messages emited by your tests with a lot of additives including timestamp.
How the demo designed
Please read the source of the project to find how the demo designed.
Desired Reporting frameworks …
In the Katalon Forum, many people have expressed their wishes that they want to view the test reports using their favorites reporting frameworks. For example;
- Does Katalon support integration of other reporting frameworks such as, Allure or Extent Report? If yes, how?
- How to customize Report Generation?
Yes, you can develop your code so that it satisfies your requirements by extracting necessary information out of what Katalon Studio provides. Your code should feed the information to your favourites reporting frameworks. That is no different from what I have done here. However, I would remind you that it would involve a lot of your efforts compiling nicely formatted custom report.