# Add a file to report folder

**URL:** <https://forum.katalon.com/t/add-a-file-to-report-folder/62379>\
**Category:** Feature Request\
**Tags:** katalon-testops\
**Created:** [February 10, 2022, 11:03am UTC](https://forum.katalon.com/t/add-a-file-to-report-folder/62379 "2022-02-10T11:03:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmta.support](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/cmta.support/32/16104_2.png) [@cmta.support](https://forum.katalon.com/u/cmta.support)\
**Post date:** [February 10, 2022, 11:03am UTC](https://forum.katalon.com/t/add-a-file-to-report-folder/62379/1 "2022-02-10T11:03:21Z")

</div>

Hi,

I’m currently working on test integration.

I’m using Jenkins and TestOps. I found out that we can access files after a test suite run.

I want to create custom report because the plugins open source are not what we want.

I tried this code

```
File directoryPath = new File("Reports/");
String[] contents = directoryPath.list();
String last_folder_created = contents[contents.length-2]
File file = new File("Reports/" + last_folder_created + "/<Test Suite Name>/" + last_folder_created + "/customReportFile.txt")

```

The path i mentioned here is the path that is visible when you want to access reports in the testOps app.

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/9/e/9e3866292bff8a3abfa09d71800005f044b49141.png)  
But since this path is generated at the end of the test suite, is it possible to add a file that can be accessible in the testOps file review ?

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [February 10, 2022, 12:57pm UTC](https://forum.katalon.com/t/add-a-file-to-report-folder/62379/2 "2022-02-10T12:57:25Z")

</div>

FAO @devalex88 @duyluong @ThanhTo @Jass

---

<div class="post-metadata">

**Author:** ![Jass](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/jass/32/9588_2.png) [@Jass](https://forum.katalon.com/u/Jass)\
**Post date:** [February 11, 2022, 4:42am UTC](https://forum.katalon.com/t/add-a-file-to-report-folder/62379/3 "2022-02-11T04:42:49Z")

</div>

Assigned @nam.nguyen on February 11, 2022, 4:42am UTC



---

<div class="post-metadata">

**Author:** ![nam.nguyen](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/nam.nguyen/32/18640_2.png) [@nam.nguyen](https://forum.katalon.com/u/nam.nguyen)\
**Post date:** [March 9, 2022, 7:11am UTC](https://forum.katalon.com/t/add-a-file-to-report-folder/62379/4 "2022-03-09T07:11:24Z")

</div>

Hi @cmta.support,

Sorry for my late response,

The current mechanism of KS is to upload files in supported formats (like .txt, .csv,…) so the answer is it’s possible.

I’ve tried to create a file with below snippet, and it works:

```
File directoryPath = new File('Reports/')
File[] files = directoryPath.listFiles();
if (files == null || files.length == 0) {
	return null;
}

File lastModifiedFile = files[0];
for (int i = 1; i < files.length; i++) {
   if (lastModifiedFile.lastModified() < files[i].lastModified()) {
	   lastModifiedFile = files[i];
   }
}

String last_folder_created = lastModifiedFile.getName()

File file = new File(((('Reports/' + last_folder_created) + '/Simple TS/') + last_folder_created) + '/customReportFile.csv')

boolean successful = file.createNewFile()

```

Below is the result:

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/4/1/41f7b03a9a00a3201e7dcaf8f67d4925b291c2e6.jpeg)

Regards,  
Nam Nguyen.
