# Is there a way to label executed test suites?

**URL:** <https://forum.katalon.com/t/is-there-a-way-to-label-executed-test-suites/25114>\
**Category:** Integrations\
**Tags:** integrations, katalon-studio\
**Created:** [May 10, 2019, 2:45pm UTC](https://forum.katalon.com/t/is-there-a-way-to-label-executed-test-suites/25114 "2019-05-10T14:45:46Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kim](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@Kim](https://forum.katalon.com/u/Kim)\
**Post date:** [May 10, 2019, 2:45pm UTC](https://forum.katalon.com/t/is-there-a-way-to-label-executed-test-suites/25114/1 "2019-05-10T14:45:46Z")

</div>

We run a collection of test suites every day and we want to tie them back to a sprint version. Is there any way to change the ID or add a label?

Thank you!

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [May 10, 2019, 4:51pm UTC](https://forum.katalon.com/t/is-there-a-way-to-label-executed-test-suites/25114/2 "2019-05-10T16:51:49Z")

</div>

First thing that pops into my head…

There is a description field, but modifying it/reading it at runtime… not sure the APIs exist to do that. You would probably have to use a listener before and after to do it. It is possible, I do something similar in my test cases (I store JSON data in the TC description field). Non-trivial though.

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/c/cf8c5a8c954109a6c6ba3a6463f5e4f41ced826b.png)

---

<div class="post-metadata">

**Author:** ![Kim](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@Kim](https://forum.katalon.com/u/Kim)\
**Post date:** [May 10, 2019, 6:27pm UTC](https://forum.katalon.com/t/is-there-a-way-to-label-executed-test-suites/25114/3 "2019-05-10T18:27:10Z")

</div>

Thank you! We will take a look a this and see if it works for us.

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [May 10, 2019, 6:39pm UTC](https://forum.katalon.com/t/is-there-a-way-to-label-executed-test-suites/25114/4 "2019-05-10T18:39:43Z")

</div>

Wait and see if others have better ideas.

---

<div class="post-metadata">

**Author:** ![Ibus](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@Ibus](https://forum.katalon.com/u/Ibus)\
**Post date:** [May 10, 2019, 6:40pm UTC](https://forum.katalon.com/t/is-there-a-way-to-label-executed-test-suites/25114/5 "2019-05-10T18:40:58Z")

</div>

why do you want to do that from the application running the test?  
in my understanding, this is a matter of collecting history.  
i supose you don’t run the tests manualy, being a repetitive task, but from certain CI tool.  
the way i did: in the jenkins job, after the task is executed,i collect the status/exit code, based on it will send emails with certain message, grab the reports and upload to an internal apache server etc.

---

<div class="post-metadata">

**Author:** ![Kim](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@Kim](https://forum.katalon.com/u/Kim)\
**Post date:** [May 10, 2019, 6:48pm UTC](https://forum.katalon.com/t/is-there-a-way-to-label-executed-test-suites/25114/6 "2019-05-10T18:48:13Z")

</div>

We currently execute our test suites manually. We tried using Jekins but we couldn’t get it to work consistently and person working on that was assigned to a different project.

---

<div class="post-metadata">

**Author:** ![Ibus](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@Ibus](https://forum.katalon.com/u/Ibus)\
**Post date:** [May 10, 2019, 7:01pm UTC](https://forum.katalon.com/t/is-there-a-way-to-label-executed-test-suites/25114/7 "2019-05-10T19:01:39Z")

</div>

proposal:  
let’s focus on doing it properly.  
put your choosen CI alive2 (jenkins, travis whatever), run the tests, grab reports with the name you like.

who/what is blocking you?

don’t get it wrong, but from my experience, it will take less effort to learn a new tool and use it to grab togheter some pieces in the pipeline, compared with the willing to modify a tool to do everything your boss was dreaming past night.

so … let’s sit togheter and have a small brainstorming:  
what are the requests, resources, goals … and limitations?

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [May 10, 2019, 7:12pm UTC](https://forum.katalon.com/t/is-there-a-way-to-label-executed-test-suites/25114/8 "2019-05-10T19:12:21Z")

</div>

Moving to Integrations.

---

<div class="post-metadata">

**Author:** ![Kim](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@Kim](https://forum.katalon.com/u/Kim)\
**Post date:** [May 10, 2019, 9:26pm UTC](https://forum.katalon.com/t/is-there-a-way-to-label-executed-test-suites/25114/9 "2019-05-10T21:26:47Z")

</div>

Well, there is a longer story. Basically we have been writing manual test cases for a long time across all of our products. We switched to automating with Katalon a little over a year ago and started by automating test cases that were all ready created.

My team is now evaluating the process of why we write manual and automated tests for the same test case. Test cases in TFS have areas that you can query and create KPI reports (for managers). I understand that Katalon Analytics has reporting but they would like to have something connected to one location (I actually created a different thread for this). They also were interested in seeing if there was a way to display an iteration number in Katalon Analytics, which is why I am asking about a label.

---

<div class="post-metadata">

**Author:** ![Ibus](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@Ibus](https://forum.katalon.com/u/Ibus)\
**Post date:** [May 11, 2019, 9:30am UTC](https://forum.katalon.com/t/is-there-a-way-to-label-executed-test-suites/25114/10 "2019-05-11T09:30:24Z")

</div>

well … first you will need a certain machine to play with, where to collect the reports.  
preferably a linux one with docker installed, can be any distribution of your choice (centos ubuntu, debian, whatever you like)

one simple setup can be to just setup an apache server.  
it is not very complicated to set it up, because i am lazy i just used a docker image

see: [https://hub.docker.com/\_/httpd](https://hub.docker.com/_/httpd)

i used the alpine one because the of the small size

having this, you can run your test via a certain script, at the end grab the generated report, rename it the way you like and upload to the apache folder. will be a bit tricky to keep the ‘index’ of it, but a simple solution will be to add the current date in the report name.

a better option will be to use jenkins. running jenkins it is not very complicated, again docker to the rescue.  
The doc is pretty explanatory on how to set it up:

> <https://github.com/jenkinsci/docker/blob/master/README.md>

for a simple setup you don’t need the

```auto
-p 50000:50000

```

option, that is required only when using remote executors, so the command to start jenkins will be sort of:

```auto
docker run -p 8080:8080 --name jenkins --rm -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts

```

having jenkins set up, now you have two options: publish the generated reports to your apache server (it can be hosted on the same machine with jenkins) \< the benefit compared with running the test via a script is that you will have available also the BUILD\_NO in addition to date of run, through the jenkins environment variables.

Also, instead of using an apache server, you can publish the generated reports using the HTML Publisher plugin, see:

[https://wiki.jenkins.io/display/JENKINS/HTML+Publisher+Plugin](https://wiki.jenkins.io/display/JENKINS/HTML+Publisher+Plugin)

That’s one way to do it, I was using jenkins just because it was already available for our team, but you can use any other CI tool, there are plenty available

---

<div class="post-metadata">

**Author:** ![Ibus](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@Ibus](https://forum.katalon.com/u/Ibus)\
**Post date:** [May 12, 2019, 1:30pm UTC](https://forum.katalon.com/t/is-there-a-way-to-label-executed-test-suites/25114/11 "2019-05-12T13:30:42Z")

</div>

Other dirty options:  
I was looking a bit into the html code of the generated report.  
Looks like the title (and some other properties) of the report are generated by the following snippet:

```auto
<body>
------
<div id="header"></div>
<div id="statistics-container"></div>

<script type="text/javascript">
$(document).ready(function() {
    try {
        var topsuite = window.testdata.suite();
    } catch (error) {
        addJavaScriptDisabledWarning(error);
        return;
    }
    initLayout(topsuite.name, 'Log');
    //addStatistics();
    addErrors();
    addExecutionEnvironmentInfo(window.environment_info);
    addTestExecutionLog(topsuite);
    addLogLevelSelector(window.settings['minLevel'], window.settings['defaultLevel']);
    if (window.location.hash) {
        makeElementVisible(window.location.hash.substring(1));
    } else {
        expandSuite(topsuite);
    }
    
    if($("s1").attr('class') == 'element-header closed'){
		toggleSuite('s1')
	}
	$("#s1").find("div[id*='s1-t']").each(function(){
		toggleTest(this.id);
	});
    
});

```

the **topsuite** var is built using the

```auto
window.testdata.suite()

```

function which returns something like:

 ![Console](https://europe1.discourse-cdn.com/katalon/original/2X/a/a7674a29655633fea2b13921bd599b9f0b3ebf5f.png)

and later some other strings are appended to it.

the **window** object seems to be populated by the following script:

```auto
<script type="text/javascript">
window.output["strings"] = window.output["strings"].concat([
"*","*New Test Suite","*","*","*Test Cases/SampleTestCase FAILED because (of) Unable to verify response status code (Root cause: Expected status code is '200' but actual status code is '301')","*Test Cases/SampleTestCase","*Test Cases/SampleTestCase FAILED because (of) Unable to verify response status code (Root cause: Expected status code is '200' but actual status code is '301')","*Statement - requestObj = \&quot;New Request\&quot;","*define the test object","*Statement - response = com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords.sendRequest(com.kms.katalon.core.testobject.ObjectRepository.findTestObject($requestObj))","*","*Send request successfully","*verifyResponseStatusCode","*","*Expected status code is '200' but actual status code is '301'","*Unable to verify response status code (Root cause: Expected status code is '200' but actual status code is '301')"]);
</script>

```

So, I changed a bit the code of the script to look like this:

```auto
<script type="text/javascript">
window.output["strings"] = window.output["strings"].concat([
"*","*My Custom Title for Suite:","*","*","*Test Cases/SampleTestCase FAILED because (of) Unable to verify response status code (Root cause: Expected status code is '200' but actual status code is '301')","*Test Cases/SampleTestCase","*Test Cases/SampleTestCase FAILED because (of) Unable to verify response status code (Root cause: Expected status code is '200' but actual status code is '301')","*Statement - requestObj = \&quot;New Request\&quot;","*define the test object","*Statement - response = com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords.sendRequest(com.kms.katalon.core.testobject.ObjectRepository.findTestObject($requestObj))","*","*Send request successfully","*verifyResponseStatusCode","*","*Expected status code is '200' but actual status code is '301'","*Unable to verify response status code (Root cause: Expected status code is '200' but actual status code is '301')"]);
</script>

```

The rendered report now looks like:

 ![Report](https://europe1.discourse-cdn.com/katalon/original/2X/d/d69ab7309dcf8f7f4a599c14dab26702b5319ba5.png)

So .. after the test is executed and report generated, you can modify it using a certain parsing method and get a custom one  
How to do that … that’s another story, feel free to use your imagination.

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [May 12, 2019, 3:14pm UTC](https://forum.katalon.com/t/is-there-a-way-to-label-executed-test-suites/25114/12 "2019-05-12T15:14:31Z")

</div>

Nice @Ibus. However, you should be aware that the reporting system (and probably therefore the templates used) are being rewritten.

In my view, if you need an alternative reporting system, you would do better to write and rely on your own – or wait for the devs to implement something like mine:

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/0/003e924ba5d77667114619100f34b2beda711caf.png)

You can Read about it here (and @devalex88’s response immediately after)…

> [@How can I customize test reports in Katalon Studio?](http://forum.katalon.com/t/how-can-i-customize-test-reports-in-katalon-studio/14101/5):
>
> I’m sorry guys, I can’t make a reasonably concise post detailing how my system works - not to the degree that would help others. In a recent online meeting with @devalex88 and an earlier one with @YoungNgo, it took upwards of 30 minutes just to show them the system and the code behind it. That said, I’ll tell you this much: It involves seizing some control of the startup conditions for both Test Suites and Test Cases. Test Listeners are your friends here. The listeners call into classes/method…

---

<div class="post-metadata">

**Author:** ![Ibus](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@Ibus](https://forum.katalon.com/u/Ibus)\
**Post date:** [May 12, 2019, 5:40pm UTC](https://forum.katalon.com/t/is-there-a-way-to-label-executed-test-suites/25114/13 "2019-05-12T17:40:19Z")

</div>

@Russ_Thomas yeah … i know some stuff will change, so i just did a quick dirty hack in the final html … because i had nothing else to do (or not in mood to do the tasks assigned to me by my wife)  
mostly, my intention was to show an possible workflow, using developer tools to hack into the result.  
once the new reporting system will see the light, if the time afford it, i will hack deeper straight into templates 🙂 unless the team will surprise us and enable certain feature to customize them

personaly, i am not using katalon anymore at work … because i changed my job, so now i am on the python side.  
but is still play with katalon in my free time, just for fun
