Email reporting

Hi,
I want to add the test scenarios which have been executed during test run while sending execution report in email and also wanted to update the subject line of email while send report in email?

is it possible?

i tried to do the setup using below link but didn’t find that how subject line or message body can be updated after completion of test case.
ex - Test Case execution finished with 80% …

https://docs.katalon.com/display/KD/Emails+Settings

1 Like

Shashi said:

Hi,
I want to add the test scenarios which have been executed during test run while sending execution report in email and also wanted to update the subject line of email while send report in email?

is it possible?

i tried to do the setup using below link but didn’t find that how subject line or message body can be updated after completion of test case.
ex - Test Case execution finished with 80% …

https://docs.katalon.com/display/KD/Emails+Settings

Hi Shashi,

Unfortunately, it is not supported yet by Katalon Studio. We will consider it in the future.

Thanks for your suggestion,
Liam

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

Thanks you.
I wrote my utility and imported the same in katalon :slightly_smiling_face:

Thanks,
Shashi

Could you please share the code or utility you used.?

1 Like