import java.time.LocalDateTime
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
def now = LocalDateTime.now()
WebUI.comment("Now it is ${now}!")
println("Now it is ${now}")
I got the following output in the log:
SLF4J: The requested version 1.7.16 by your slf4j binding is not compatible with [1.6]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
2018-12-03 07:14:19.810 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2018-12-03 07:14:19.815 INFO c.k.katalon.core.main.TestCaseExecutor - START Test Cases/TC1
2018-12-03 07:14:20.784 DEBUG testcase.TC1 - 1: now = LocalDateTime.now()
2018-12-03 07:14:20.838 DEBUG testcase.TC1 - 2: comment(Now it is $now!)
2018-12-03 07:14:21.116 DEBUG testcase.TC1 - 3: println(Now it is $now)
Now it is 2018-12-03T07:14:20.837
2018-12-03 07:14:21.149 INFO c.k.katalon.core.main.TestCaseExecutor - END Test Cases/TC1
I expect WebUI.comment() also to emit a string “Now it is 2018-12-03T07:14:20.837!” but it doesn’t.
If that is not working, as a workaround, use println for console output (usually I use WebUI.comment only to throw some data in the generated html report … so I cannot say the new behavior is disturbing …)
Also, you can try to use KeywordUtil.logInfo(). even if the purpose of it is for usage in custom keywords, should work in a testcase too.
Thank you for your suggestion. I tried the following log.properties file setting and got WebUI.comment() output.
# This file is used to configure Katalon Studio execution log levels.
logging.level.com.kms.katalon.core=TRACE
However, I would argue that the output from WebUI.comment() should be regarded as INFO level. Therefore it should be emitted to the LogView even if logging.level.com.kms.katalon.core is set DEBUG. Otherwise WebUI.comment() loses its raison d’etre.
Thank you for your suggestion. I tried the following log.properties file setting and got WebUI.comment() output.
# This file is used to configure Katalon Studio execution log levels.
logging.level.com.kms.katalon.core=TRACE
However, I would argue that the output from WebUI.comment() should be regarded as INFO level. Therefore it should be emitted to the LogView even if logging.level.com.kms.katalon.core is set DEBUG. Otherwise WebUI.comment() loses its raison d'etre.
I agree This should have been turned on by default
I’m so glad I have not upgraded. I make extensive use of the logging and commenting systems as part of my customized reporting solution. This, I’m sure, would break my tests and put me on total shutdown.
@YoungNgo Please light a fire back there and get this fixed asap.
Yep, thanks Kaz. I’m sure that’s true. I think I’ll wait until this bug is cleared - I don’t want to be chasing any problems that aren’t of my own making
now honestly. using reporting/logging info for further validations/customization’s is just a bad practice
we will always have the ‘chicken and egg’ problem: who is checking the checking code?
Hi @Shane_McGarry,
Please update your version to the latest 5.10.1.
I’ve checked your issue and found that WebUI.comment() now can print the comment to the log.
My sincere apologies @Loan_Tran. After following your example, I see that I did not expand the comment command ("1 - comment(“The following can be […]”) in the Log Viewer and then click on the comment text (“The following can be […]”) that displays. This was not an option for version 5.10, as seen in the image from my original post, so I initially missed the change when I had seen missing text for my stored variables. Sorry.
I have confirmed on Mac (OS version 10.14.1) and PC (Windows 10 version 10.0.16299) that this has indeed been addressed and resolved. Thank you and your team for your assistance.