Get results HTML path/filename through code

Is it possible to programmatically get the path and filename of the results HTML within a testcase script please? I’d like to automatically copy the results to another location at the end of my test run.

I found half my answer… RunConfiguration.getReportFolder()
However, even if I copy the folder in the @AfterTestSuite section of the Test Listener, while I do see a execution0.log file containing results information in XML, the results HTML and CSV files have not been created at this point, so I’m not sure how I could accomplish what I need without writing a wrapper to call Katalon’s CLI to kick off the tests and THEN do the copy process. Any thoughts please?

I don’t use the built in reporting stuff. A little over three years ago, I realized the same thing and wrote my own. There were two main reasons why I felt this important enough to do that:

  1. I wanted complete control of the startup and shutdown of suites and test cases AND the reporting mechanism.

  2. The built in reports are noisy. I really (I mean, REALLY) don’t care about PASSES. They’re just noise. I want to know what failed and why. A list of fails is all I care about. Period.

However, if you’re thinking of going this route, be aware it’s a lot of effort - worth it in my case, but I can’t speak for you or anyone else.

1 Like

I have ever done similar thing in my VisualTestingInKatalonStudio. It was a lot of effort.

My design looks something like this:

  1. create a Test Suite Collection “TSC” which comprises with 2 Test Suites “TS_visit” and “TS_report”.
  2. TS_visit does WebUI testing and creates reports.
  3. TS_report reads the report files created by TS_visit and does something (mangling files, copying them, etc)

Here arises a problem.

How a test case script in the TS_report can be informed of the name (or path) of the reports created by the preceding TS_visit?

Katalon Studio does NOT provide any method to pass information across the boundary between 2 Test Suites. Therefore I had to persist the information into a JSON file with fixed path in the project. I wrote that codes in the TestListener.

As you can see, the code is complicated. I am reluctant to talk about it. I would not recommend you to follow what I have done.

1 Like

The following post describes how to create a custom report.
I guess that @Russ_Thomas did something like this.

That’s right. He did.

Actually I think that’s a great workaround. I’m surprised that there’s not a mechanism within Katalon do do this, but your solution is perfectly acceptable - thanks!

No, there isn’t. You need to help yourself.

1 Like