Selenium: Excel Read and Write – using java jExcel(jxl)

According to – jexcel API is to read and write excel sheet data,


  • Excel should be of .xls format , if it is a .xlxs format, then open the excel and click onFile -> Save As and choose “Excel 97-2003 WorkBook” format.
  • We can’t edit an existing excel, but can create a new excel(copy existing excel content) and update the content.

Required jar file: jxl.jar, click here to download the zip jexcelapi and get the required jar file.

Place the excel file under the project folder (for ease access)
Enter excel data something like this:


Here, 1st row is the column header / description.

Code to read and write an excel file:

And the output is:

Content posted is based on learning or working experience,
Share the post with others if find useful,
Any queries?, leave comments or discuss on our, Thanks!

2 Responses

  1. Mukesh says:

    Hey Sunil,

    Finally back again…. Waiting for more post.. Cheers 🙂

  2. Admin says:

    Thanks buddy, this helps us to learn..
    U too keep sharing, so we can learn more…

Leave a Reply

Your email address will not be published. Required fields are marked *