How to print integer values in Generated HTML Reports

Hi,

I would like to print Integer values in Generated HTML Reports. With the help of KeywordLogger ,We can displays only the Strings rather than displaying integer values.

Kindly provide me the solution to solve the issue.

import com.kms.katalon.core.util.KeywordUtil

for (int count = 3; count >= 0; count--) {
	KeywordUtil.logInfo("count: $count")
}
KeywordUtil.logInfo("done")

When I execute this test case, I got the following output in the Console.

2019-01-31 10:10:42.842 e[39mDEBUGe[0;39m e[36mtestcase.printInteger                    -e[0;39m e[39m1: logInfo(count: $count)e[0;39m
2019-01-31 10:10:42.843 e[34mINFO e[0;39m e[36mcom.kms.katalon.core.util.KeywordUtil    -e[0;39m e[39mcount: 2e[0;39m
2019-01-31 10:10:42.845 e[39mDEBUGe[0;39m e[36mtestcase.printInteger                    -e[0;39m e[39m1: logInfo(count: $count)e[0;39m
2019-01-31 10:10:42.846 e[34mINFO e[0;39m e[36mcom.kms.katalon.core.util.KeywordUtil    -e[0;39m e[39mcount: 1e[0;39m
2019-01-31 10:10:42.847 e[39mDEBUGe[0;39m e[36mtestcase.printInteger                    -e[0;39m e[39m1: logInfo(count: $count)e[0;39m
2019-01-31 10:10:42.849 e[34mINFO e[0;39m e[36mcom.kms.katalon.core.util.KeywordUtil    -e[0;39m e[39mcount: 0e[0;39m
2019-01-31 10:10:42.850 e[39mDEBUGe[0;39m e[36mtestcase.printInteger                    -e[0;39m e[39m2: logInfo("done")e[0;39m
2019-01-31 10:10:42.853 e[34mINFO e[0;39m e[36mcom.kms.katalon.core.util.KeywordUtil    -e[0;39m e[39mdonee[0;39m
2019-01-31 10:10:42.856 e[34mINFO e[0;39m e[36mc.k.katalon.core.main.TestCaseExecutor   -e[0;39m e[39mEND Test Cases/PrintingInteger/printIntegere[0;39m

Is this what you want?

The Escape characters in the Console annoys me.

2 Likes

Yea, its worked for me .

Thanks for your valuable suggestion.

Hi Kaz,

My setup:
Window7, 64bit
Katalon Studio; Version: 5.10.1; Build: 1
Chrome; Version 71.0.3578.98 (Official Build) (64-bit)

The following prints to my Console view but when I run the test through a test suite the AcctNbr is not printing to the html, csv reports. Any suggestion for doing this?

Thanks,
Dave

import com.kms.katalon.core.util.KeywordUtil as KeywordUtil
KeywordUtil.logInfo('AcctNbr: ’ + GlobalVariable.AcctNbr)

Results:
Console= 2019-02-14 08:43:34.534 e[34mINFO e[0;39m e[36mc.k.katalon.core.main.TestCaseExecutor -e[0;39m e[39mAcctNbr = 2B4238S4

Reports= logInfo("AcctNbr: " + AcctNbr)

I tried to reproduce your problem on my Mac. Please find the capture of the HTML report attached.

I could find “AcctNbr: 2B4238S4” in the HTML produced by test suite. So, I could not reproduce your problem. I have a doubt you looked at something different.

What is this line?

Hi Kaz,
You are absolutely correct!

My bad, I did not drill down into the test step.

I am seeing the AcctNbr as expected.

Thank you for you quick response and help.

Cheers,
Dave