Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
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 Aug 17 '12 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. – Saik0 Aug 17 '12 at 12:47
up vote 2 down vote accepted

I guess this link should answer all your questions.

share|improve this answer
Welcome 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. – corsiKa Sep 24 '12 at 14:55
Thanks @corsiKa – Saik0 Dec 20 '12 at 8:01

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.