我在使用excel进行数据驱动测试时遇到此错误。我已经添加了3.6版本的POI Jar.Below是错误:
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)
答案 0 :(得分:0)
excel文件已损坏。一旦修复,问题就解决了。