Excel Reader Selenium
Excel Reader Selenium
columnName) {
try {
Cell cell = row.getCell(0); // Assuming the row name is in the first column (column 0)
if (cell.getStringCellValue().equals(rowName)) {
rowIndex = row.getRowNum();
break;
// Finding the column index based on the column name in the first row
Row headerRow = sheet.getRow(0); // Assuming the column names are in the first row
if (cell.getStringCellValue().equals(columnName)) {
columnIndex = cell.getColumnIndex();
break;
}
}
workbook.close();
file.close();
return data;
} else {
workbook.close();
file.close();
} catch (IOException e) {
e.printStackTrace();