自己写的 UI 自动化框架用 excel 管理测试数据,框架启动时用 jxl 加载文件,报 StringIndexOutOfBoundsException。相关代码:
其中红框处报这个异常,如下:
ExcelData 数据文件加载失败!
java.lang.StringIndexOutOfBoundsException: String index out of range: 120
at java.lang.String.checkBounds(Unknown Source)
at java.lang.String.(Unknown Source)
at jxl.biff.StringHelper.getString(StringHelper.java:164)
at jxl.read.biff.WriteAccessRecord.(WriteAccessRecord.java:56)
at jxl.read.biff.WorkbookParser.parse(WorkbookParser.java:821)
at jxl.Workbook.getWorkbook(Workbook.java:271)
at jxl.Workbook.getWorkbook(Workbook.java:253)
at myframework.uitest.data.ExcelData.(ExcelData.java:38)
at myframework.uitest.run.Runner.run(Runner.java:57)
at TestRunner.main(TestRunner.java:45)
测试执行中出现异常!
java.lang.NullPointerException
at myframework.uitest.data.ExcelData.getCommonData(ExcelData.java:119)
at myframework.uitest.run.Runner.startTest(Runner.java:81)
at myframework.uitest.run.Runner.run(Runner.java:59)
at TestRunner.main(TestRunner.java:45)
此框架在以前的电脑上正常运行,换了电脑后遇到此问题,有人遇到过吗??求助啊!