Hello, is there a setting to generate an HTML file so it can be accessed immediately before the test script is finished?
I’m having trouble. I manually integrated Jira with a listener and uploaded supporting documents to Jira. The only files my script can upload are .png and console0, but the HTML file isn’t found because it only appears after the script finishes running.
Dear zedromason,
Thank you for your question, here I might have some recommendations which I have found:
Problem Analysis
Based on the documentation, HTML reports in Katalon are generated AFTER test execution completes, not during execution. According to the Katalon Studio Test Reports documentation:
“This feature enables auto-generation of reports in the selected format… generated after each test suite execution”
The HTML report file is not available until the test script finishes running. This is why your listener can only access.png files and console logs during execution, and these are generated in real-time, but the HTML report is compiled at the end.
Root Cause
This is by design in Katalon Studio. The HTML report requires complete test execution data to generate a comprehensive summary, so it cannot be created until all tests finish running.
Solutions
Option 1: Use Real-Time Monitoring with Katalon TestOps (Recommended)
Instead of waiting for the HTML report, integrate with Katalon TestOps for real-time monitoring:
Solution: Enable Katalon TestOps integration to view execution reports in real-time before the test finishes.
Source: Katalon TestOps Real-Time Monitoring
“For real-time monitoring and better reporting capabilities, consider integrating your project with Katalon TestOps.”
Option 2: Upload Available Files During Execution
Since your listener has access to.png and console logs during execution, you can:
- Collect intermediate artifacts (screenshots, logs) during test execution
- Upload these to Jira immediately via your listener
- Upload the final HTML report after execution completes using a post-execution hook
Implementation Example:
groovy
// In your listener - upload during execution
def onTestCaseFinished(TestCaseContext testCaseContext) {
// Upload screenshots and logs to Jira immediately
uploadScreenshotsToJira(testCaseContext)
uploadLogsToJira(testCaseContext)
}
// After test suite completes - upload HTML report
def onTestSuiteFinished(TestSuiteContext testSuiteContext) {
// Now the HTML report is available
uploadHTMLReportToJira(testSuiteContext)
}
Option 3: Generate Custom Real-Time Reports
Create your own intermediate report format that updates during execution:
- Use a JSON or CSV file that your listener updates after each test case
- Upload this intermediate report to Jira during execution
- Replace it with the final HTML report when execution completes
Reference: View Katalon Studio Test Results in Jira Tickets
So far, our recommendation will be:
Use Option 1 (Katalon TestOps) for the best real-time visibility, or combine Option 2 with your existing listener to upload intermediate results during execution and the final HTML report afterward.
Please let me know if I can further assist you,
Bella
Hi Bella, thanks for your response. Since TestOps uses a license, I’ll use option 2, and I think I’ve implemented it. However, the HTML file isn’t found in the logs I created. Is there something wrong with my script?
@AfterTestCase
def afterTestCase(TestCaseContext testCaseContext) {
long caseDuration = System.currentTimeMillis() - caseStartTime
String testCaseId = testCaseContext.getTestCaseId()
String status = testCaseContext.getTestCaseStatus()
String simpleTestCaseId = extractSimpleTestCaseId(testCaseId)
String message = testCaseContext.getMessage() ?: ""
KeywordUtil.logInfo("Test Case Selesai: ${simpleTestCaseId}")
KeywordUtil.logInfo("Status: ${status}")
KeywordUtil.logInfo("Durasi: ${caseDuration / 1000}s")
testCaseResults[testCaseId] = new TestCaseResult(
testCaseId,
simpleTestCaseId,
status,
message,
caseDuration
)
}
@AfterTestSuite
def afterTestSuite(TestSuiteContext testSuiteContext) {
long suiteDuration = System.currentTimeMillis() - suiteStartTime
KeywordUtil.logInfo("Test Suite Selesai: ${testSuiteContext.getTestSuiteId()}")
KeywordUtil.logInfo("Total Durasi Suite: ${suiteDuration / 1000}s")
KeywordUtil.logInfo("Jumlah Test Case: ${testCaseResults.size()}")
try {
processTestResults()
} catch (Exception e) {
KeywordUtil.logInfo("Error dalam penanganan Jira di afterTestSuite: ${e.message}")
e.printStackTrace()
}
}
Your @AfterTestSuite method is missing the critical step: actually creating and writing the HTML file . You’re logging information but not generating the HTML output.
Hope this can be a Solution checking out this document here: Test Fixtures and Test Listeners (Test Hooks) in Katalon Studio | Katalon Docs.
Please let me know how that goes,
Bella