Reading test data from an Excel file using JUnit and Apache POI

To maintain test cases and test data, Microsoft Excel is the favorite tool used by testers. Compared to the CSV file format, Excel gives numerous features and a structured way to store data. A tester can create and maintain tables of test data in an Excel spreadsheet easily.

Reading test data from an Excel file using JUnit and Apache POI

In this recipe, we will use an Excel spreadsheet as your data source. We will use the Apache POI API, developed by the Apache Foundation, to manipulate the Excel spreadsheet. This recipe also implements some negative test handling.

Getting ready

  • Set up a new project and add JUNIT4 to project's build path
  • Download and ...

Get Selenium Testing Tools Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.