我在运行testNG测试用例时遇到以下异常。
[TestNG] Reporter org.uncommons.reportng.HTMLReporter@527740a2 failed
org.uncommons.reportng.ReportNGException: Failed generating HTML report.
at org.uncommons.reportng.HTMLReporter.generateReport(HTMLReporter.java:122)
at org.testng.TestNG.generateReports(TestNG.java:1115)
at org.testng.TestNG.run(TestNG.java:1074)
at com.flipkart.cid.cs.Trigger.run(Trigger.java:98)
at com.flipkart.cid.cs.Trigger.main(Trigger.java:135)
Caused by: java.lang.NullPointerException
at org.uncommons.reportng.TestResultComparator.compare(TestResultComparator.java:29)
at org.uncommons.reportng.TestResultComparator.compare(TestResultComparator.java:25)
at java.util.Collections.indexedBinarySearch(Collections.java:332)
at java.util.Collections.binarySearch(Collections.java:320)
at org.uncommons.reportng.HTMLReporter.sortByTestClass(HTMLReporter.java:243)
at org.uncommons.reportng.HTMLReporter.createResults(HTMLReporter.java:193)
at org.uncommons.reportng.HTMLReporter.generateReport(HTMLReporter.java:114)
... 4 more
答案 0 :(得分:0)
您使用的是哪个版本的JDK和reportNG?
尝试使用reportNG版本1.1.4和JDK 7.也按照这篇文章,它应该解决您的问题: https://solidsoft.wordpress.com/2011/01/23/better-looking-html-test-reports-for-testng-with-reportng-maven-guide/