Java 记录一个HREF而不转义;少于;在爪哇
我们使用的是在jenkins上触发的硒测试。由于junit的附件插件由于某些原因不起作用,我想在日志中的测试截图中添加html引用 我尝试的方法是:Java 记录一个HREF而不转义;少于;在爪哇,java,html,logging,Java,Html,Logging,我们使用的是在jenkins上触发的硒测试。由于junit的附件插件由于某些原因不起作用,我想在日志中的测试截图中添加html引用 我尝试的方法是: logger.info("<a href=\"file:///" + screenshotFile.getAbsolutePath() + "\">Screenshot<a>"); System.out.println("<a href=\"file:///" + screenshotFile.getAbsolute
logger.info("<a href=\"file:///" + screenshotFile.getAbsolutePath() + "\">Screenshot<a>");
System.out.println("<a href=\"file:///" + screenshotFile.getAbsolutePath() + "\">Screenshot<a>");
System.err.println("<a href=\"file:///" + screenshotFile.getAbsolutePath() + "\">Screenshot<a>");
<pre>
//your string
</pre>
logger.info(“屏幕截图”);
System.out.println(“屏幕截图”);
System.err.println(“屏幕截图”);
无论如何,在输出中
这是常见的问题,请尝试使用pre元素包装字符串
//你的绳子
您如何查看输出println
没有转义。<有一个特殊的含义,这就是它被转义的原因,因为目标是wihtin Jenkins的日志页。但我也检查了文件系统中的输出文件..真正的问题似乎是surefire报告。这是为jenkins创建输出并执行转义的工具。我仍然没有找到解决这个问题的方法。