and in step def using like this:
new Package().method()
By creating a new custom keyword and using the plugin there like:
import the package: import keywords.Package
and create a custom keyword like this:
@Keyword
def abc(){
new Package().method()
}
but none of the above ways worked for me. Also, did not throw any error. In case I use invalid keyword name which is not available in plugin then it throws error like no signature found or something.But when providing correctly, it is not working either.
Basically i want to use keyword from the plugin in the step definition file. Is it possible?
Then, you will find the message in the JUnitResult.xml.
The <system-out> section of JUnitReport.xml will print the output emitted into System.out by the tests. println stepDescription will emit the string into System.out.
But KeywordUtl.markPassed(String message) will NOT output message into the System.out. It will print message just in the LogView of Katalon Studio.
You can check the source code of KeywordUtil#markPassed() here:
As long as you call KeywordUtil.markPassed(...) statement, I think, you will not find the message in JUnitReport.xml. If you want to see the message in JUnitReport.xml, use println instead of KeywordUtil.
Or, you can call both of println message and KeywordUtil.markPassed(message) if you like.
Actually this is getting logged as a message like [Message][Passed], I wanted it to be logged as a step, like [Test_Step][Passed], but I guess that is not possible here.
I wanted to check whether that keyword has been executed or not and for that im relying on a Test Step with log as ert.recorder.Tests.startStep.
No issues, Ill try to make changes in my other utility.