Display the execution time of a scenario

Hi Katalon Members,

I would like to write the execution time of a scenario at the end of my Excel File.

Could you tell me if there is a syntax to display the execution time of the scenario ?

Thank you

What do you mean by “scenario”?

There is no easy way. Your wish in this sentence is very hard to accomplish.

You should change your wish.

You should choose some easier approach.

In the execution0.log file you would be able to find “exection time”.

You need to parse this XML file; select the information you want; extract it; copy it to somewhere you want to store. It is very cumbersome task. Involves a lot to learn.

A Warning.The “execution0.log” file is created by Katalon Studio only after your test scripts finished completely. Your test script has no chance to read the execution0.log file while it is still running. Your script can only read the execution0.log files of the previous runs. I believe, you would dislike this constraint.

Do you want to write something into a Excel file?

Katalon Studio provides no feature to help writing anything into .xlsx.

You need to write a code using Apache POI for yourself. A quick search showed me many links; for example

Yea, I can attest to that. I have a whole bunch of code in my code base I had to write from scratch, just to implement testing a single action of a test…

posting it on here would probably not only have overwhelmed the poor OP, but also end up not being exactly what they wanted…

It didn’t even touch the log files (I didn’t even know about them at the time of writing it :exploding_head: ) let alone have anywhere near the level of detail contained in those log files…

It seems like I need to find some time and maybe create util plugin out of it…

you mention execution time of a ‘scenario’ but haven’t explained what this is - is it a test case or is it some part of a test case? Going for the simplest answer (and perhaps you have a more complicated requirement in mind):
if you only need to know how long a test case took to execute, the test suite report is available as a CSV and you can filter by the necessary text eg begins with ‘Test Case’, with the column headings below (including Duration) - or don’t filter at all, and you’ll have each test step listed.

Suite/Test/Step Name | Browser | Description | Tag | Start time | End time | Duration | Status

Katalon Studio automatically creates hella logs of your test cases, one of which is in the form of .csv file.

You can parse that and get your total time elapsed.

Even better, that entire file provides breakdown of all steps, their start/stop datetimes, durations, and status.

You can find this file in Reports/${latestTimeStamp}/${relativePathNameOfTestCaseDirectory}/${latestTimeStamp}/${latestTimeStamp}.csv

where latestTimeStamp is in the yyyymmdd_hhmmss format.

This may be exactly what you want, or you can follow @kazurayam 's steps to copy it to your Excel file.

Good luck, and let us know what the next steps are for you on this problem!

Execution Time of TestCase Please ?

No TestSuite

I think Katalon it’s not an Excellent Solution…

When I Saw your post, i see it’s very complicated to obtain this.

With other solution it’s very easy to obtain syntax like UFT Microfocus.

Besides, I timed with my phone and I did not find the same execution time as that of Katalon which is surprising !!!

It only returns the moment when Katalon processes the scenario but not the execution prerequisite and the post execution.
13sec instead of 16.36sec on my phone’s timer.

Can a Katalon Studio Expert tell me why I notice this difference?


I am not surprised about this. Katalon is designed as such. I would accept that.

The difference between 13secs and 16.36sec is not that significant for me. If the diffence counts 200sec, will be significant for me as well.

Have you ever looked at Katalon TestOps? It might interest you. I find that the web site of TestOps looks quite similar to the website of “the other solution” you mentioned.

3 seconds by Testcase. if you have 100 Testcase it’s equals 300secs

Not sure what do you mean by this.
For a certain execution, I can see in the generated report:

  • The total time for the suite
  • The time for the testcase to run
  • The time taken by the listener (I have only one, before test case) - is that a prerequisite in your terms?
    … and so on, see the screenshot:


The same data is present in the generated .csv report:

Suite/Test/Step Name,Browser,Description,Tag,Start time,End time,Duration,Status
New Test Suite,,,,2023-02-02 18:26:10,2023-02-02 18:26:11,0.454s,PASSED
Test Cases/New Test Case,,,,2023-02-02 18:26:10,2023-02-02 18:26:11,0.161s,PASSED
Start listener action : sampleBeforeTestCase,,,,2023-02-02 18:26:10,2023-02-02 18:26:10,0.018s,PASSED
"comment(""some comment"")",,,,2023-02-02 18:26:10,2023-02-02 18:26:11,0.060s,PASSED
println(myvar),,,,2023-02-02 18:26:11,2023-02-02 18:26:11,0.003s,PASSED

which you can open it directly in excel if you like:


I guess, you are unhappy because your Katalon test suite, which comprises with 100 test cases, runs too slow.

Then, have a look at the following post: