adspace


How do you read test data from excels?

Answer Posted / Ganesh Pratap Singh

To read test data from Excel files in Selenium, you can use libraries like Apache POI or XLRD (for Python) and Poi-OLE (for Java). These libraries allow you to read and write Excel files. Here's an example using Apache POI in Java:nn```javanFileInputStream fis = new FileInputStream(new File("path_to_your_excel_file"));nXSSFWorkbook workbook = new XSSFWorkbook(fis);nXSSFSheet sheet = workbook.getSheetAt(0);nxssfRow row = sheet.getRow(0);nxssfCell cell = row.getCell(0);nsString data = cell.getStringCellValue();n```

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What’s selenese?

920


what will be the first salary and what will be the hike in the salary?

929


Have you created any framework?

1038


Do you know how to locate a link using its text in selenium?

985


How can you fetch an attribute from an element? How to retrieve typed text from a textbox?

1197