# Manipulate the progress bar on test case action?

**URL:** <https://forum.katalon.com/t/manipulate-the-progress-bar-on-test-case-action/92369>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [July 1, 2023, 9:17pm UTC](https://forum.katalon.com/t/manipulate-the-progress-bar-on-test-case-action/92369 "2023-07-01T21:17:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwarren04011990](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/mwarren04011990/32/26024_2.png) [@mwarren04011990](https://forum.katalon.com/u/mwarren04011990)\
**Post date:** [July 1, 2023, 9:17pm UTC](https://forum.katalon.com/t/manipulate-the-progress-bar-on-test-case-action/92369/1 "2023-07-01T21:17:07Z")

</div>

Right now, I am running a test case, that calls a child test case 10 times…

As we can see in this screen shot, the progress bar is either all-or-nothing for this use case:

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/9/7/9793b65acf03651aa7dbb6e16eb22ec1de8d71e6.png)

The child test case has already ran successfully some n \< 10 times…

Is there any way that we can add to the number of progress bar on child test case pass?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [July 1, 2023, 10:05pm UTC](https://forum.katalon.com/t/manipulate-the-progress-bar-on-test-case-action/92369/2 "2023-07-01T22:05:53Z")

</div>

I tried to reproduce what you wrote.

Let me assume you have 2 Test Cases: “Test Case/main” and “Test Case/sub”. The “main” has the following code:

```auto
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

for (int i = 0; i < 10; i++) {
	int j = i + 1
	WebUI.callTestCase(findTestCase('Test Cases/sub'), ['seq': j])
}

```

and the “sub” has the following code:

```auto
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

WebUI.comment("seq=" + seq)
WebUI.delay(1)

```

when I ran the “Test Case/main”, I saw the following output in the console:

```auto
2023-07-02 06:54:57.781 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:54:57.785 INFO c.k.katalon.core.main.TestCaseExecutor - START Test Cases/main
2023-07-02 06:54:58.559 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:54:58.562 INFO c.k.katalon.core.main.TestCaseExecutor - CALL Test Cases/sub
2023-07-02 06:54:58.683 INFO c.k.k.c.keyword.builtin.CommentKeyword - seq=1
2023-07-02 06:54:59.728 INFO c.k.katalon.core.main.TestCaseExecutor - END CALL Test Cases/sub
2023-07-02 06:54:59.728 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:54:59.818 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:54:59.818 INFO c.k.katalon.core.main.TestCaseExecutor - CALL Test Cases/sub
2023-07-02 06:54:59.837 INFO c.k.k.c.keyword.builtin.CommentKeyword - seq=2
2023-07-02 06:55:00.858 INFO c.k.katalon.core.main.TestCaseExecutor - END CALL Test Cases/sub
2023-07-02 06:55:00.859 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:00.931 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:00.931 INFO c.k.katalon.core.main.TestCaseExecutor - CALL Test Cases/sub
2023-07-02 06:55:00.943 INFO c.k.k.c.keyword.builtin.CommentKeyword - seq=3
2023-07-02 06:55:01.957 INFO c.k.katalon.core.main.TestCaseExecutor - END CALL Test Cases/sub
2023-07-02 06:55:01.957 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:02.032 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:02.032 INFO c.k.katalon.core.main.TestCaseExecutor - CALL Test Cases/sub
2023-07-02 06:55:02.045 INFO c.k.k.c.keyword.builtin.CommentKeyword - seq=4
2023-07-02 06:55:03.058 INFO c.k.katalon.core.main.TestCaseExecutor - END CALL Test Cases/sub
2023-07-02 06:55:03.058 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:03.133 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:03.133 INFO c.k.katalon.core.main.TestCaseExecutor - CALL Test Cases/sub
2023-07-02 06:55:03.143 INFO c.k.k.c.keyword.builtin.CommentKeyword - seq=5
2023-07-02 06:55:04.163 INFO c.k.katalon.core.main.TestCaseExecutor - END CALL Test Cases/sub
2023-07-02 06:55:04.163 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:04.238 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:04.238 INFO c.k.katalon.core.main.TestCaseExecutor - CALL Test Cases/sub
2023-07-02 06:55:04.249 INFO c.k.k.c.keyword.builtin.CommentKeyword - seq=6
2023-07-02 06:55:05.260 INFO c.k.katalon.core.main.TestCaseExecutor - END CALL Test Cases/sub
2023-07-02 06:55:05.261 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:05.336 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:05.336 INFO c.k.katalon.core.main.TestCaseExecutor - CALL Test Cases/sub
2023-07-02 06:55:05.370 INFO c.k.k.c.keyword.builtin.CommentKeyword - seq=7
2023-07-02 06:55:06.384 INFO c.k.katalon.core.main.TestCaseExecutor - END CALL Test Cases/sub
2023-07-02 06:55:06.384 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:06.453 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:06.453 INFO c.k.katalon.core.main.TestCaseExecutor - CALL Test Cases/sub
2023-07-02 06:55:06.463 INFO c.k.k.c.keyword.builtin.CommentKeyword - seq=8
2023-07-02 06:55:07.475 INFO c.k.katalon.core.main.TestCaseExecutor - END CALL Test Cases/sub
2023-07-02 06:55:07.475 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:07.547 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:07.547 INFO c.k.katalon.core.main.TestCaseExecutor - CALL Test Cases/sub
2023-07-02 06:55:07.558 INFO c.k.k.c.keyword.builtin.CommentKeyword - seq=9
2023-07-02 06:55:08.568 INFO c.k.katalon.core.main.TestCaseExecutor - END CALL Test Cases/sub
2023-07-02 06:55:08.569 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:08.638 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:08.638 INFO c.k.katalon.core.main.TestCaseExecutor - CALL Test Cases/sub
2023-07-02 06:55:08.648 INFO c.k.k.c.keyword.builtin.CommentKeyword - seq=10
2023-07-02 06:55:09.661 INFO c.k.katalon.core.main.TestCaseExecutor - END CALL Test Cases/sub
2023-07-02 06:55:09.662 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2023-07-02 06:55:09.678 INFO c.k.katalon.core.main.TestCaseExecutor - END Test Cases/main

```

In the GUI, the Job Progress showed 2 views: at first when it started:

 ![スクリーンショット 2023-07-02 7.02.54](https://europe1.discourse-cdn.com/katalon/original/3X/a/b/aba7483e979859f4cbd1e0618a286025dc98b1ba.png)

then 10 seconds later, it chainged to

 ![スクリーンショット 2023-07-02 7.03.10](https://europe1.discourse-cdn.com/katalon/original/3X/5/3/53d76ae24d3f426e33d6c214dbdaa483ffafcbd5.png)

The Job Progress showed no progress; it started and finished. That’s all.

I could reproduce what @mwarren04011990 reported.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [July 1, 2023, 10:06pm UTC](https://forum.katalon.com/t/manipulate-the-progress-bar-on-test-case-action/92369/3 "2023-07-01T22:06:36Z")

</div>

> [@mwarren04011990](#):
>
> Is there any way that we can add to the number of progress bar on child test case pass?

No, there is no way.

I will tell you why as follows.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [July 1, 2023, 10:16pm UTC](https://forum.katalon.com/t/manipulate-the-progress-bar-on-test-case-action/92369/4 "2023-07-01T22:16:18Z")

</div>

You can find the source code of `CallTestCase` keyword of an old version Katalon Studio here:

> <https://github.com/katalon-studio/katalon-studio-testing-framework/blob/master/Include/scripts/groovy/com/kms/katalon/core/keyword/builtin/CallTestCaseKeyword.groovy>

You can find the source of related classes including `TestCaseExecutor` here:

> <https://github.com/katalon-studio/katalon-studio-testing-framework/blob/master/Include/scripts/groovy/com/kms/katalon/core/main/TestCaseExecutor.java>

Please read the method `public TestResult execute(FailureHandling flowControl)` of `TestCaseExecutor`. You can find the following fragment:

```auto
            if (testCaseContext.isMainTestCase()) {
                eventManager.publicEvent(ExecutionListenerEvent.BEFORE_TEST_CASE, new Object[] { testCaseContext });
            }

```

and

```auto
            if (testCaseContext.isMainTestCase()) {
                eventManager.publicEvent(ExecutionListenerEvent.AFTER_TEST_CASE, new Object[] { testCaseContext });
            }

```

I believe that `Test Case/main` will return true for `isMainTestCase()` but `Test Case/sub` returns false. So the `eventManager` will be informed of the progress of the `main` only; it won’t be informed of the progress of the `sub` at all. Therefore the Job Progress window displays the progress of the `Test Case/main` only; it does not display anything about the `Test Case/sub`.

Why is the `TestCaseExecutor` designed as such? — I don’t know. Ask Katalon. I personally have no preference about the Job Progress window.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [July 2, 2023, 12:09am UTC](https://forum.katalon.com/t/manipulate-the-progress-bar-on-test-case-action/92369/5 "2023-07-02T00:09:31Z")

</div>

I can guess why the Job Progress monitor is designed to show only the Main test case, why it ignores the Sub test case.

The Katalon Studio GUI needs to know, prior to starting the job, how many Test Cases are there in total to monitor. For example, let me assume I have a Test Suite X contains Test Cases A, B, C; then the number of Test Cases to monitor is obviously 3. Provided that the total number of Test Cases to monitor is known, the GUI can draw a progress bar (0/3, 1/3, 2/3, and 3/3; Done). Without the total number of Test Cases to monitor is givien, GUI can not draw a progress bar.

Then how many Test Cases Katalon Studio GUI will find when I executed the `Test Case/main` ? ---- only 1.

Why the GUI does not respect the number of times where the `Test Case/sub` is called? — because the number will be determined only after the Main test case has been started. The `main` will determine how many times it will call the `sub` (may be only once, 10 times, or 1000 times). The `main` will never inform Katalon GUI of the count. Therefore Katalon GUI will never be able to render the Job Progress with the calls to the Sub test cases appropriately.

So, I guess, Katalon developers designed the Job Progress to disregard the Sub test cases at all.
