Category: Selenium Web Driver With Java

How to read and write data in excel using selenium web driver with java

Read Data from excel in Java. public static XSSFSheet readExcel(String Path, String SheetName) { try { System.out.println(Path); // Open the Excel file FileInputStream ExcelFile = new FileInputStream(Path); // Access the required test data sheet ExcelWBook = new XSSFWorkbook(ExcelFile); ExcelWSheet = ExcelWBook.getSheet(SheetName); } catch (Exception e) { System.out.println(e); } return ExcelWSheet; } How to read data from excel in selenium web driver with java. To call the above method: XSSFSheet excelSheet = TestListener.readExcel("DataFiles\\testData.xlsx",