I am unable to read excel using jxl from classpath however the same code is working fine with standalone code.
Excel is placed in src/main/resources/test.xls
Workbook workbook = null; InputStream stream =this.getClass().getClassLoader().getResourceAsStream("test.xls"); workbook = Workbook.getWorkbook(stream); Sheet sheet = workbook.getSheet(0); Cell a1 = sheet.getCell(0,0);
However if I use the file system path as
workbook = Workbook.getWorkbook(new File("src/main/resources/test.xls "));
I am able to read in jbehave.
Is this an issue with Jbehave since standalone code works in both the ways.