![]() |
VOOZH | about |
The Apache POI is one of the most popular java libraries for selenium data-driven testing. It is mainly used for handling all types of Microsoft documents such as MS Word, and MS Excel. MS word and others. Apache POI is an open-source library and POI stands for "Poor Obfuscation Implementation".
We need to download the Apache POI to get started with the Apache POI library.
Geeks, for creating a maven project with seleniumcheck this article How to Create a Selenium Maven Project with Eclipse to Open Chrome Browser?
Now create the Excel sheet with two columns Salary and bonus and calculate the Total using the Formula. If we try to read the data from the Formula table we usually occur errors. So we try to read the data in the formula data type itself.
Save the Excel File and paste the location in the file input stream in the code.
After Executing the program, we will get the all data from Excel.
FileInputStream file = new FileInputStream("file location");
case FORMULA:
System.out.print(cell.getNumericCellValue());