I have a feature-rich library (TeamControlium Controlium) that I am trying to integrate with Katalon. The library produces messages (debug, information, etc…). The library has a method that takes a consumer and passes the messages out to that consumer.
However, I can seem to get the wiring correct in Katalon.
In Java world I’d have a method; IE (bad example but get the idea…);
private void messageReceiver(String line) {
println(line);
}
and as part of test startup I say;
Logger.setTestToolLog(this::messageReceiver);
All output from the libraries (and indeed in-test writes) gets written to messageReceiver that - in this case - just puts it out to the stdout stream.
In Katalon, i want to say:-
def messageReceiver(String line) {
new KeywordLogger().logInfo(line);
}
However, I cant seem to get it right. I’ve tried in a Keyword package and I’ve tried in a ‘Test case’, but always get an error along the lines of MissingPropertyException. Is there a trick to being able to do this?