我遇到以下异常:
FreeMarker模板错误: 以下评估为null或缺失: ==> log.stepName [在模板“Extent.Offline.ftl”第297行,第93栏]
提示:如果已知失败的表达式合法地引用有时为null或缺失的内容,则指定默认值,如myOptionalVar!myDefault,或使用< #if enter code here
myOptionalVar ??> -present<#其他>在缺失。 (这些仅涵盖表达式的最后一步;要覆盖整个表达式,请使用括号:(myOptionalVar.foo)!myDefault,(myOptionalVar.foo)??
at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:131)
at freemarker.core.EvalUtil.coerceModelToString(EvalUtil.java:355)
at freemarker.core.Expression.evalAndCoerceToString(Expression.java:82)
at freemarker.core.DollarVariable.accept(DollarVariable.java:41)
在freemarker.core.Environment.visit(Environment.java:324)
在freemarker.core.MixedContent.accept(MixedContent.java:54)
在freemarker.core.Environment.visitByHiddingParent(Environment.java:345)
在freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:48)
在freemarker.core.Environment.visit(Environment.java:324)
在freemarker.core.MixedContent.accept(MixedContent.java:54)
在freemarker.core.Environment.visitByHiddingParent(Environment.java:345)
at freemarker.core.IteratorBlock $ IterationContext.executeNestedBlockInner(IteratorBlock.java:268)
at freemarker.core.IteratorBlock $ IterationContext.executeNestedBlock(IteratorBlock.java:220)
at freemarker.core.IteratorBlock $ IterationContext.accept(IteratorBlock.java:194)
在freemarker.core.Environment.visitIteratorBlock(Environment.java:572)
at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:78)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:64)
在freemarker.core.Environment.visit(Environment.java:324)
在freemarker.core.MixedContent.accept(MixedContent.java:54)
在freemarker.core.Environment.visitByHiddingParent(Environment.java:345)
at freemarker.core.IteratorBlock $ IterationContext.executeNestedBlockInner(IteratorBlock.java:268)
at freemarker.core.IteratorBlock $ IterationContext.executeNestedBlock(IteratorBlock.java:220)
at freemarker.core.IteratorBlock $ IterationContext.accept(IteratorBlock.java:194)
在freemarker.core.Environment.visitIteratorBlock(Environment.java:572)
at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:78)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:64)
在freemarker.core.Environment.visit(Environment.java:324)
在freemarker.core.MixedContent.accept(MixedContent.java:54)
在freemarker.core.Environment.visit(Environment.java:324)
在freemarker.core.Environment.process(Environment.java:302)
at freemarker.template.Template.process(Template.java:325)
在com.relevantcodes.extentreports.HTMLReporter.flush(HTMLReporter.java:151)
在com.relevantcodes.extentreports.Report.flush(Report.java:213)
at com.relevantcodes.extentreports.ExtentReports.flush(ExtentReports.java:491)
在com.mobile.app.sainity.testcases.Sainity.main(Sainity.java:147)
java.lang.NullPointerException
at java.io.Writer.write(Unknown Source)
at com.relevantcodes.extentreports.utils.Writer.write(Writer.java:21)
at com.relevantcodes.extentreports.HTMLReporter.flush(HTMLReporter.java:164)
at com.relevantcodes.extentreports.Report.flush(Report.java:213)
at com.relevantcodes.extentreports.ExtentReports.flush(ExtentReports.java:491)
在com.mobile.app.sainity.testcases.Sainity.main(Sainity.java:147)
答案 0 :(得分:0)
您可以升级到最新版本2.40版本。对于离线报告,它对我来说很好。