As we all are aware reading and writing data from excel file is one of the most important aspects that we need to take care while designing our automation testing framework especially while using a data-driven testing approach.
So in this Section, we will learn how we can read multiple rows
and column value from excel file which contains a large set of data.
Apache POI API is an open-source library created by Apache
Software that allows us to create, modify and work with other Microsoft Office
Product.
To start working and reading multiple values from excel we first
need to download Apache POI maven dependency or JAR. Please click on this link to download this from the maven repository.
In this Section, I am using below maven dependencies.
For Demo purpose, I have created below excel sheet named Test Data and kept it on
my Desktop.
In this blog I am
creating one generic utility Named “getCellData” that will loop over all the
rows of excel sheets to read it.
Below is the complete
code snippet. In This code, I am trying to read all the rows and columns present
in the excel sheet.
Result of above code
execution is
row decalred as String object, is that correct?
Reply