1
我收到數據驅動測試excel的錯誤。我添加了POI Jar的3.6版本.Below是錯誤:org.apache.poi.openxml4j.exceptions.InvalidOperationException:無法打開指定的文件:
org.apache.poi.openxml4j.exceptions.InvalidOperationException: Can't open the specified file: 'C:\Users\pjadhav1\AppData\Local\Temp\poifiles\poi-ooxml-747722852.tmp'
at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:102)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:199)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:178)
at org.apache.poi.util.PackageHelper.open(PackageHelper.java:53)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:176)
at com.iopendr.xls.read.Xls_Reader.<init>(Xls_Reader.java:32)
at com.iopendr.test.DriverScript.start(DriverScript.java:96)
at com.iopendr.test.DriverScript.main(DriverScript.java:60)
1560 [main] DEBUG devpinoyLogger - *********INITIALIZE ALL TESTCASES IN***********Login
Exception in thread "main" java.lang.NullPointerException
at com.iopendr.xls.read.Xls_Reader.getRowCount(Xls_Reader.java:43)
at com.iopendr.test.DriverScript.start(DriverScript.java:106)
at com.iopendr.test.DriverScript.main(DriverScript.java:60)
有沒有文件權限的權限?雖然它似乎並不是這裏的情況,但只是問,也可以在這裏發佈一些代碼 –
這可能是http://stackoverflow.com/questions/12350775/unable-to-open-excel-using- apachepoi-getting-exception? – Qben
我的excel文件被損壞,所以錯誤顯示。錯誤已解決。 – pratik