【发布时间】:2013-10-14 10:37:01
【问题描述】:
我在使用 excel 进行数据驱动测试时遇到此错误。我添加了 3.6 版本的 POI Jar。以下是错误:
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)
【问题讨论】:
-
没有文件权限的情况下吗?虽然这里似乎不是这样,但只是问一下,还请在这里发布一些代码
-
这可能是 stackoverflow.com/questions/12350775/… 的副本吗?
-
我的 excel 文件已损坏,因此出现了错误。错误已解决。
标签: java excel selenium-webdriver apache-poi data-driven