How to display values in Report

Hi ,
I am testing the load performance for my application. am calculating the time for table load and storing it in variable. Now I want to display that readings in the report. Could u pls help me here?

This is my code -

WebUI.click(findTestObject(‘Object Repository/ExistingUI_OR/pafinationoff’))
long start2 = System.currentTimeMillis();
WebUI.focus(findTestObject(‘Object Repository/ExistingUI_OR/c_Table’))
long finish2 = System.currentTimeMillis()
long totalTime2 = finish2 - start2
long Seconds = (totalTime2 /1000)
System.out.println(“Total Time for page load - “+Seconds +” Seconds”)

Hi @tejal.potdar,

You can use KeywordUtil and create a log for it to be displayed in the report.

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

KeywordUtil log = new KeywordUtil()
log.logInfo(“Total Time for page load - “+Seconds +” Seconds”)

Hope that helps. . . :slight_smile:

Thank You @Arnel,
but still it is not showing the value for Variable ‘Seconds’ in the report.

Can you share some screenshots? thanks

Yes…Please find screensots-

Hmmmmm that looks weird… I’m using KeywordUtil class and whenever I used it, logs are being displayed in the report.

I’m starting to think that it might be a version issue or some settings. But I may be wrong.

try this another logger class

import com.kms.katalon.core.logging.KeywordLogger

KeywordLogger logger = new KeywordLogger()
logger.logInfo("")

Hope that works now. . .:smiley:

Nothing fancy but you can also use:

WebUI.comment("Total Time for page load - "+Seconds +" Seconds")

Hi @grylion54 / @Arnel

Still I am not able to display value in report. Here is the screenshot-

I have used the below statement -

WebUI.comment((’\nTotal Time for page load after clicking on GlideUI Link - ’ + SecondsAfterDftDisTab) +
’ Seconds\n’)

Am I missing any steps?
Also I used KeywordLogger, but still no luck:(

@tejal.potdar

I guess, you have changed log configuration of your project, which could affect the log output.

Could you share the content of Include > Config > log.properties file?

Hi @kazurayam

This is the content of log.properties file -

# This file is used to configure Katalon Studio execution log levels.

# When you need to troubleshoot Katalon Studio issue
# logging.level.com.kms=TRACE

logging.level.com.mycompany=DEBUG

log.properties file has nothing harmful.

Does your test code use any the logging framework logback?

Hi All,

logger.logInfo("") worked.

Now I am able to see the value for Variable in report but in PDF format only. Thats okay!!!

Thank You so much guys :slightly_smiling_face:

That’s Great! Glad it works.

You’re welcome.

Cheers :beers: