File IO is a critical part for any software process. We frequently create a file, open it & update something or delete it in our Computers. Same is the case with Selenium Automation. We need a process to manipulate files with Selenium.
Java provides us different classes for File Manipulation with Selenium. In this tutorial we are going to learn how can we read and write on excel file with the help of Java IO package and Apache POI library.
- How to handle excel file using POI (Maven POM Dependency)To read or write an Excel, Apache provide a very famous library POI. This library is capable enough to read and write both XLS and XLSX file format of excel.To read XLS files an HSSF implementation is provided by POI library.To read XLSX , XSSF implementation of POI library will be the choice. Let's study these implementations in detail.
If you are using maven in your project the maven dependency will be
Or you can simply download the latest version POI jars from http://poi.apache.org/download.html & download poi-bin-3.10-FINAL-20140208.zip
When you download the zip file for this jar , you need to unzip it and add these all jars to the class path of your project.