RE: How to Write WebTable values in Excel as Input
Hi,
I am automating through KFW , I am reading the data from WebTable, [Consist of 50 records] and I want use that Data as Input and would like to store value in Excel in particular column. say 1st row 1 cell.
I wrote below line of code. but Test case excel file is getting corrupted.
FileInputStream fileInputStream = new FileInputStream(…xlsx filename);
XSSFWorkbook Workbook = new XSSFWorkbook(fileInputStream);
XSSFSheet sheet = Workbook.getSheet(sheetname);
for (Row Myrow : sheet) {
for (Cell Mycell : Myrow) {
XSSFCell Row = sheet.getRow(1).getCell(1);
Row.setCellValue(columnname of webtable);
}
}
FileOutputStream fileOut = new FileOutputStream(…xlsx filename);
fileOut.close();
Please let me know better approach Or better solution/code
Thanks in advance.
Shripad
shripad
It is worked Mistake in the loop.