An ability to write out data values from fields to an excel file when executing a script

An ability to write out data variables to Excel. E.g. I am testing a retail application and each time I create an order, the system generates an order number that I would like to capture and write out to an Excel file.

Ideally I would like to write to the same Excel file I have used as my data input


I really wonder a solution for that

I’ll second this Iain my old mate I could do with this, it would be an excellent addition to a great product


You can create custom keyword for this which will read data from screen and write the output to the excel file.

May be you can try this:-

package writeDataToExcel

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase

import static com.kms.katalon.core.testdata.TestDataFactory.findTestData

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import com.kms.katalon.core.annotation.Keyword

import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint

import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory


import com.kms.katalon.core.model.FailureHandling

import com.kms.katalon.core.testcase.TestCase

import com.kms.katalon.core.testcase.TestCaseFactory

import com.kms.katalon.core.testdata.TestData

import com.kms.katalon.core.testdata.TestDataFactory

import com.kms.katalon.core.testobject.ObjectRepository

import com.kms.katalon.core.testobject.TestObject

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords

import internal.GlobalVariable

import MobileBuiltInKeywords as Mobile

import WSBuiltInKeywords as WS

import WebUiBuiltInKeywords as WebUI




import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import org.apache.poi.hssf.usermodel.HSSFSheet;




public class WriteDataToExcelSheet



def WriteDatatoDataFile(String username, Integer rownum)


String xlsPath = (“C:\\XXX\\KatalonStudio_XXX\\XXX\\Data Files\\XXX_Dataset.xls”);

File f1=new File(xlsPath);

FileInputStream fIPS= new FileInputStream(xlsPath); //Read the spreadsheet that needs to be updated

HSSFWorkbook wb = new HSSFWorkbook(fIPS);

HSSFSheet ws = wb.getSheetAt(0);


FileOutputStream fout=new FileOutputStream(f1);





I implemented using Apache POI

This type of request is going trendy, and the following feature may suits your needs. If you think it does, you may upvote it for Katalon guys to add it in a further release :

1 Like