Reading data from an Excel file

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

Let's create an Excel spreadsheet, named data.xlsx, in the src/test/resources/data folder with the following contents:

In this section, 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.

Let's modify the provider() method to use a helper ...

Get Selenium WebDriver 3 Practical Guide - Second Edition 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.