I am trying to write data in excel.
FileOutputStream oFile = new FileOutputStream(yourFile, false);
HSSFWorkbook workbook=new HSSFWorkbook();
HSSFSheet sheet=workbook.createSheet("Script_ID");
HSSFRow rowheading =sheet.createRow(0); // throws exceptiom
rowheading.createCell(0).setCellValue(" XYZ");
rowheading.createCell(1).setCellValue("ABC");
The same code is working in Selenium but when i am trying the same code in IBM RFT it is throwing NullPointerException in createRow (mentioned above) and it is not creating new Sheet named "Script_ID". So not able to write any data in excel.
Can any one suggest me what is wrong with the code or any simple approach to write the data in excel as i have to iterate the code in 2 column in multiple rows in multiple sheets under the same excel file.