0

运行我的 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
4

1 回答 1

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/

于 2015-03-10T17:29:45.487 回答