在运行以下代码时,我发现以下异常。请帮我解决问题。我也尝试过更改 freemaker jar 文件。
public class sample1 {
public static void main(String[] args) throws IOException {
ExtentHtmlReporter htmlReporter = new
ExtentHtmlReporter("extent.html");
ExtentReports extent = new ExtentReports();
extent.attachReporter(htmlReporter);
ExtentTest test = extent.createTest("MyFirstTest", "Sample description");
test.log(Status.INFO, "This step shows usage of log(status, details)");
test.info("This step shows usage of info(details)");
MediaEntityBuilder
.createScreenCaptureFromPath("screenshot.png")
.build());
test.addScreenCaptureFromPath("screenshot.png");
extent.flush();
}
}
错误详情:
Exception in thread "main" java.lang.NoSuchFieldError: VERSION_2_3_23
at com.aventstack.extentreports.reporter.ExtentHtmlReporter.start(ExtentHtmlReporter.java:93)
at com.aventstack.extentreports.Report.attach(Report.java:55)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
at com.aventstack.extentreports.ExtentReports.attachReporter(ExtentReports.java:68)
at com.br.mainsript.sample1.main(sample1.java:23)