# FileNotFoundException

**URL:** <https://forum.katalon.com/t/filenotfoundexception/28060>\
**Category:** Web Testing\
**Tags:** web-testing, katalon-studio\
**Created:** [June 18, 2019, 12:40pm UTC](https://forum.katalon.com/t/filenotfoundexception/28060 "2019-06-18T12:40:35Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Andreas\_Voit](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@Andreas\_Voit](https://forum.katalon.com/u/Andreas_Voit)\
**Post date:** [June 18, 2019, 4:16pm UTC](https://forum.katalon.com/t/filenotfoundexception/28060/5 "2019-06-18T16:16:54Z")

</div>

I didn’t tested your example, but I think you should also close the file?

```auto
file.close();

```

I found an example:

```auto
@Keyword
def void writeToExcel(String text ){
	FileInputStream file = new FileInputStream (new File("D:\\Testdata.xlsx"))
	XSSFWorkbook workbook = new XSSFWorkbook(file);
	XSSFSheet sheet = workbook.getSheetAt(0);
	Cell searchText = sheet.getRow(1).getCell(1);
	searchText.setCellValue(text);
	file.close();
	FileOutputStream outFile =new FileOutputStream(new File("D:\\Testdata.xlsx"));
	workbook.write(outFile);
	outFile.close();
}

```

Source: [Write into excel at runtime during test execution - #6 by nhi](http://forum.katalon.com/t/write-into-excel-at-runtime-during-test-execution/8391/6)

Theres also an example for your usecase:

> [@Write into excel at runtime during test execution](http://forum.katalon.com/t/write-into-excel-at-runtime-during-test-execution/8391/13):
>
> Melinda Lakner said: I would like to get different texts and write them into excel into different cells, but now only the last appears not all. I don’t know why. I needed to write data to excel. I created Custom Keyword for that. Under Keywords right click and select NEW -\> PACKAGE. Name it writeToExcel (or however you want) After that right click your package and select NEW -\> KEYWORD. Name it WriteExcel (or however you want). Inside your new keyword add this code (my code has package …

---

_[View the full topic](https://forum.katalon.com/t/filenotfoundexception/28060)._
