I would like to know, do we use Apache POI when interacting with Excel Files for Selenium Webdriver (under JUnit framework) or is there any better approach?
Let me know if further clarity is required.
Thanks, Saikat
-
It may depend on what you need to do with the Excel file. An alternative would be to convert from Excel to CSV, and then analyze the CSV.user246– user2462012年08月17日 01:53:39 +00:00Commented Aug 17, 2012 at 1:53
-
@user246 Thank you for the reply. My requirement is to read the data from the excel and pass that as arguments to a Selenium function.Saikat– Saikat2012年08月17日 12:47:44 +00:00Commented Aug 17, 2012 at 12:47
2 Answers 2
I guess this link should answer all your questions.
-
poi.apache.org/spreadsheet/quick-guide.html#NewWorkbookvirus– virus2012年09月24日 07:13:53 +00:00Commented Sep 24, 2012 at 7:13
-
2Welcome to the site, Virus. Typically, a single link answer is frowned upon (particularly due to link rot). Perhaps you could take a few moments to apply some of the knowledge in the link directly to the question at hand.2012年09月24日 14:55:39 +00:00Commented Sep 24, 2012 at 14:55
Yes, you can use Apache POI for interacting with Excel Files for Selenium WebDriver (under JUnit framework). You can also use TestNG instead of JUnit if anybody wants.
The following things can be done by using Apache POI:
i) Reading data from Excel (both .xls and .xlsx) ii) Writing data to Excel (both .xls and .xlsx)
You can also use JExcel for reading and writing in Excel. But the limitation is that it doesn't support .xlsx format