Email reporting

Hi Shashi

is it possible?

Like Liam said, it’s not possible right now in Katalon Studio’s UI to configure the KS email reporting system the way you describe. However…

KS tests run in groovy. In groovy, you can write your own classes (and load them in KS as Keyword classes) which do pretty much anything you want. In other words, you could write your own reporting/emailing system that behaves exactly the way you want it to.

Take a look at this comment from another discussion – it shows what my HTML email report looks like for a single test case:

If you want to try this you will need to learn to write your own Keyword classes (https://docs.katalon.com/display/KD/Define+custom+keywords)

You can use Test Listeners (https://docs.katalon.com/pages/viewpage.action?pageId=5126383) to handle the start and end methods for your report on disk and add a specialized comment method (as a Keyword method) to each of your test steps which writes additional lines to the report on disk. In my system, the report on disk is only sent as an email if the test case fails.

Here is my Test Listener class where you can see my startReport and endReport methods being used:

class AnnounceTest extends com.my_company.Report {
  @BeforeTestCase
  def beforeTestCase(TestCaseContext testCaseContext) {
    String tcId = testCaseContext.testCaseId
    startReport(tcId)
    writeAUTMessage '00 - RUNNING TEST: "' + tcId + '" on ' + G["TARGET_URL"]
  }
  
  @AfterTestCase
  def afterTestCase(TestCaseContext testCaseContext) {
    writeAUTMessage '00 - EXIT TEST'
    endReport(testCaseContext.testCaseId)
    if(GlobalVariable.SUITEID) {
      closeBrowser()
    }
  }
}


I use this program (for Windows) to send the email: http://caspian.dotconf.net/menu/Software/SendEmail/

I hope this helps.

2 Likes