自定义testNG报告如: Reporter.log("<a href=./img/" + jpgName + " target=_blank>Failed Screen Shot</a>", true);
如果在IDE中执行脚本,需要配置如下:
设置Run->Run Configurations->(x)=Arguments, VW arguments输入-Dorg.uncommons.reportng.escape-output=off, 这个是设置Eclipse的设置
如果命令行执行脚本,需要修改pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId>
... ...
... ...
<systemPropertyVariables>
<org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output>
</systemPropertyVariables>
</configuration>
</plugin>