Posts

Showing posts from May, 2018

Page Object Model Framework In Selenium with Extent Reporting...

Image
Package Structure: ExcelReader.java (A Class file to fetch data from Excel) ========================================== package excelInputAndOutput; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class ExcelReader { Workbook workbook; public String getCellData(String filePath,String fileName, String sheetName, int rowno, int colno) throws IOException{ File file = new File(filePath+"\\"+fileName); FileInputStream inputstream = new FileInputStream(file); String fileExtensionName = fileName.substring(fileName.indexOf(".")); if(fileExtensionName.equals(".xlsx")){ workbook = new XSSFWorkbook(inputstream); }else if(fileEx...