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
    Commented 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
    Commented Aug 17, 2012 at 12:47

2 Answers 2


I guess this link should answer all your questions.

  • 2
    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
    Commented 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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