Issues in Reading from Excel file | Selenium Forum
M
Posted on 22/06/2016
I do have red x in front of my project explorer[/color]


This is my code:


public class Reading_XLS_Files {

public static void main(String[] args) {
// TODO Auto-generated method stub

Xls_Reader datatable = new Xls_Reader ("C:\\Users\\Sailalitha\\Desktop\\DataToRead");
datatable.getRowCount("Record");


}

}


This is what Sam also having trouble with:
I am getting the following error:

java.io.FileNotFoundException: C:\Users\Sailalitha\Desktop\DataToRead (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at Xls_Reader.<init>(Xls_Reader.java:34)
at Reading_XLS_Files.main(Reading_XLS_Files.java:7)
Exception in thread "main" java.lang.NullPointerException
at Xls_Reader.getRowCount(Xls_Reader.java:46)
at Reading_XLS_Files.main(Reading_XLS_Files.java:8)

M
Replied on 22/06/2016

pass "C:\\Users\\Sailalitha\\Desktop\\DataToRead.xlsx" in xls reader