How do you read test data from excels?



How do you read test data from excels?..

Answer / 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

More Selenium Interview Questions

what is the difference between type keys and type commands?

1 Answers  


What will be the different kinds of locators in selenium?

1 Answers  


Mention what is desired capability? How is it useful in terms of selenium?

1 Answers  


Can you write the code to double click an element in selenium?

1 Answers  


How can you mark a test case as failed by using soft assertion?

1 Answers  


How can we find the value of different attributes like name, class, value of an element?

1 Answers  


What is the selenium webdriver?

1 Answers  


What is the difference between implicit wait and explicit wait?

1 Answers  


How to type text in a textbox using selenium?

1 Answers  


Explain the meaning of the statement in Selenium and what are the types of assertion?

1 Answers  


Explain me how to check a checkbox in selenium?

1 Answers  


What is XPath? How does it work?

1 Answers  


Categories