Вот код.
//TO GET TEST DATA FROM THE EXCEL
public static Object[][] getData(Xls_Reader xls, String testcaseName){
// test case sheet name.
// check if the sheet is present or not
if(!xls.isSheetExist(testcaseName)){
return new Object[1][0];
}
int rows=xls.getRowCount(testcaseName);
int cols=xls.getColumnCount(testcaseName);
// data array to store the data
Object[][] data=new Object[rows-1][cols-3];
for (int rowNum=2;rowNum<=rows;rowNum++){
for(int colNum=0;colNum<=cols-4;colNum++){
data[rowNum-2][colNum]=xls.getCellData(testcaseName, colNum, rowNum);
}
}
return data;
}