HTML Report Issue

n the HTML report, the screenshot is not attached, but in the PDF report, the screenshot is present. I’m facing this issue in version 10.1.1 on the reporting side.

1 Like

To resolve the missing screenshots in the HTML report while they appear in the PDF report in Katalon Studio 10.1.1, follow these steps:

1. Verify Screenshot Configuration

Ensure screenshots are enabled and saved to the correct directory:

  1. In Project Settings > Execution > Default, confirm:
  • Record Screenshots is set to On (for failed/passed steps).
  • Report Folder: Note the path (e.g., ${GlobalVariable.G_ReportFolder}/Images).

2. Manually Capture Screenshots

Explicitly take screenshots and embed them in the report:

groovy

import com.kms.katalon.core.util.KeywordUtil

// Take screenshot and log it to the report
String screenshotPath = WebUI.takeScreenshot()
KeywordUtil.logInfo("Screenshot: " + screenshotPath)

3. Check Report Directory Structure

After test execution:

  1. Navigate to the report folder (e.g., Reports/<execution-date>).
  2. Verify the Images subfolder contains .png files.
  3. In the HTML report, inspect the <img> tags to confirm the src paths point to valid files (e.g., Images/screenshot_12345.png).

4. Adjust Katalon Preferences

Force Katalon to include screenshots:

  1. Go to Window > Preferences > Katalon > Execution.
  2. Ensure Take Screenshot on Execution is checked for Passed, Failed, and Error steps.

5. Use a Custom Test Listener

Override screenshot handling with a listener:

  1. Create a Listener:

groovy

// File: Keywords/listeners/CustomReportListener.groovy
import com.kms.katalon.core.annotation.AfterTestStep
import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

class CustomReportListener {
  @AfterTestStep
  def afterTestStep(def testCaseContext, def testStepContext) {
    if (testStepContext.getStepStatus() == "FAILED") {
      String screenshotPath = WebUI.takeScreenshot()
      KeywordUtil.logInfo("Screenshot: " + screenshotPath)
    }
  }
}
  1. Assign the Listener to your test case via Test Listeners.

6. Rebuild the HTML Report

If screenshots exist in the folder but aren’t linked:

  1. Navigate to the report folder.
  2. Delete the existing HTML report.
  3. Rebuild it via Tools > Test Results > Rebuild Report.

7. Update Katalon Studio

If the issue persists, upgrade to the latest version (e.g., 10.2.0+) where HTML report rendering may have been fixed.

Troubleshooting Notes

  • Permission Issues: Run Katalon as an administrator to ensure write access to the report directory.
  • Path Length Limit: Shorten the project path (Windows has a 260-character limit for file paths).
  • Antivirus/Firewall: Temporarily disable software that might block file operations.

By ensuring screenshots are properly captured, linked, and stored, you should see them in both HTML and PDF reports.

I tried to reproduce your finding, but I couldn’t. The HTML report on my machine has screenshots attached.

My environment:

  • MacOS 14.7.5
  • Katalon Studio 10.1.1 Free

I created a new project based on the sample project

I executed the Test Suites/healthcare-test - TS_RegressionTest. The test cases failed due to an already-known-reason. I expected a screenshot to be taken on the failure and attached to the HTML report.

The following screenshots show what I got:

I found a screenshot is attached to the HTML report. I could not reproduce what you reported.

Could you explain in more detail what you found problematic?