Need Logs for CustomKeywords

Hi Team,

When we are using Custom Keywords in our projects, there are no logs for custom keywords. So we couldn’t find where the error came. Could you please check and if is it possible please do development for this otherwise let me know why you have developed like this.

Hello,

what logs do you mean? If an exception occurs, test is failed and exception is displayed. Otherwise you must implement your own logging infrastructure in custom keywords.

Hi Marek,

We need to print a step by step stack trace for custom keyword.

Stack trace is printed automatically when exception occurs, isn’t it?

You can use KeywordUtil.logInfo(String) in your Custom Keyword to print messages in the Katalong Log.

https://api-docs.katalon.com/com/kms/katalon/core/util/KeywordUtil.html

Your custom keyword calling KeywordUtil.logInfo behaves just like WebUI.comment(String)

See the last line i have called a custom keyword (commonUtilities.RSMPlant.clickContinueButton()) is passed. But there are no logs for the execution of that keyword. Can you get my point?

And what info do you expect? Every single action is logged only at test case level. If you want to log some important parts of your custom keyword, use methods which @kazurayam provided.

Thank you !!!

So any other way to get that stack trace of custom keyword, because we have used lots of custom keyword in our projects. Whenever the error came we don’t know where it occurs.

Well, exception’s stack trace always contains line numbers where exception happens. You should be able to determine the line in test case as well as the line in custom keyword.

If you can provide one of your exceptions, I can tell you where the problem is.

change the logging level to trace in your project

Someone (hint hint) should write a Tips&Tricks article about that - the docs are a little vague to say the least.

Hi Marek,

Good Morning…

Did you faced “Unresolved compilation problem” while running through your project via katalon?