How can we read test data from excel file in Selenium-Cucumber-Java
--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at https://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/d/optout.
import org.apache.poi.ss.usermodel.Cell;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;
InputStream in = new FileInputStream("path to excel file");Workbook wb = new XSSFWorkbook(in);in.close();Sheet sheet1 = wb.getSheet("Sheet1");Row row = sheet1.getRow(0);Cell a1 = row.getCell(0);String a1Value = a1.getStringCellValue();