Because I’ve been asked to add failed test case IDs to the body of the Report email template, I’ve written a separate @AfterTestSuite method in a Listener that will build a mock of the email template as I want.
Currently, I’d like to know if there’s a way to determine, at runtime (likely in a @BeforeTestSuite method), if a single TestSuite is being run or is it a TestSuiteCollection? This will help me to determine the kind of information that I’m generating in the Report email.
That’s my fear.
I do think the feature request posted would alleviate this issue as well.
In the meantime, I can search to see if there’s another way of injecting the list of failed test cases into the email templates directly. I’ve tried with a Global Variable that is updated by the listener, but it seems like the Templates are created during the build process in some way and don’t update properly throughout the run
Katalon’s feature of sending Email is not customizable at runtime. It is designed dumm.
You would want to create a new set of code that genates email text and send it to SMTP server for yourself. Sending an email from Java/Groovy is not really difficult. See
You will find a chance to send a email in a TestListener’s @AfterTestSuite-annoted method.
Email might not be the best way to publish the test-result information. Writing the information to DB, publishing it as a text into Slack, or any other method you can try.
In my TestListener, I currently have a method (rather long admittedly) that builds the email and body (copied from the Templates in \settings\internal\com.kms.katalon.execution.properties)
The issue I’m facing now is simply trying to determine when to send the TestSuite email or the TestSuiteCollection email
Running TestSuiteNumber1, the Report folder contains just “TestSuiteNumber1”
Running TestSuiteCollection, the Report folder contains “TestSuiteNumber1”, “TestSuiteNumber2”, AND “TestSuiteCollection”
My Solution:
Therefore, I have in my TestListener something like this: