# Is possible to add in html or pdf reports, the git current branch?

**URL:** <https://forum.katalon.com/t/is-possible-to-add-in-html-or-pdf-reports-the-git-current-branch/163746>\
**Category:** Web Testing\
**Tags:** pdf-report, reports, web-testing\
**Created:** [February 3, 2025, 2:58pm UTC](https://forum.katalon.com/t/is-possible-to-add-in-html-or-pdf-reports-the-git-current-branch/163746 "2025-02-03T14:58:13Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [February 13, 2025, 11:57am UTC](https://forum.katalon.com/t/is-possible-to-add-in-html-or-pdf-reports-the-git-current-branch/163746/11 "2025-02-13T11:57:59Z")

</div>

@amartinezalf

I modified the code of [Extent Report sample](https://github.com/coty/extent-report-sample) a bit.

```auto
package com.katalon.extent.report
...
public class ExtentReport {
    ...
	@Keyword
	def startEReport(TestCaseContext testCaseContext) {
		if(getExecutionSourceName.startsWith("Test Suite")) {
			String driverString = DriverFactory.getExecutedBrowser().getName()
			String execID = RunConfiguration.getExecutionSourceName()
			String testcasename = testCaseContext.getTestCaseId().substring(testCaseContext.getTestCaseId().lastIndexOf('/') + 1)
			extentTest = extent.createTest(execID+" : "+testcasename, "Test Execution: "+testCaseContext.getTestCaseId());
			extentTest.assignAuthor("HOST: "+RunConfiguration.getHostName().toUpperCase())
			extentTest.assignCategory("BROWSER: "+driverString.substring(0, driverString.indexOf("_")))
			extentTest.assignCategory("PROFILE: "+RunConfiguration.getExecutionProfile().toUpperCase())
			extentTest.assignCategory("GROUP: "+TestCaseFactory.findTestCase(testCaseContext.getTestCaseId()).getTag().toUpperCase())
			
            extentTest.assignCategory("GIT BRANCH:" + "master") // @kazurayam inserted this statement
		}
		else {
			WebUI.comment("To Generate an Extent Report execute tests from the Test Suite.")
		}
	}

```

The report showed `"GIT BRANCH: master"`, as follows

 ![スクリーンショット 2025-02-13 20.54.41](https://europe1.discourse-cdn.com/katalon/original/3X/3/e/3e4d8670f0008d892cdd8aee8a8bb8ffff6d88ef.jpeg)

It was easy.

---

_[View the full topic](https://forum.katalon.com/t/is-possible-to-add-in-html-or-pdf-reports-the-git-current-branch/163746)._
