Busniess Name: Sourabh Sharma
Qtr No. 213, New Town Yehlanka
Indore 454775, India
How would you read data from an excel file for parameterization in Playwright file ?
import com.microsoft.playwright.*;
public class ExcelParameterizationExample {
public static void main(String[] args){
try {
FileInputStream file = new FileInputStream(new File("data.xlsx"));
XSSFWorkbook workbook = new XSSFWorkbook(file);
XSSFSheet sheet = workbook.getSheetAt(0);
Iterator<Row> rowIterator = sheet.iterator();
while (rowIterator.hasNext()) {
Row row = rowIterator.next();
Cell cell = row.getCell(0);
System.out.println(cell.getStringCellValue());
}
workbook.close();
file.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
To get all Infosys Certified Playwright Java Automation Tester Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee