【发布时间】:2012-08-11 00:40:43
【问题描述】:
我必须在 TestNG 中设置 'sysproperty key="org.uncommons.reportng.escape-output" value="false"/'。
- 让我知道如何使用 eclipse 来实现。
- 如果我无法使用 eclipse 设置属性,请告诉我如何创建 TestNG ANT 任务。
提前致谢。
【问题讨论】:
标签: eclipse ant selenium testng reportng
我必须在 TestNG 中设置 'sysproperty key="org.uncommons.reportng.escape-output" value="false"/'。
提前致谢。
【问题讨论】:
标签: eclipse ant selenium testng reportng
如果您不需要经常更改它,您还可以将它作为 syspropertyVariable 添加到 pom.xml 中的 maven-surefire-plugin 中,就像这样。否则,请使用之前答案中的 VM 参数。
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.6</version>
<configuration>
<properties>
<property>
<name>usedefaultlisteners</name>
<value>false</value>
</property>
<property>
<name>listener</name>
<value>org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter</value>
</property>
</properties>
<reportsDirectory>target/surefire-reports</reportsDirectory>
<skipTests>false</skipTests>
<systemPropertyVariables>
<org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output>
</systemPropertyVariables>
</configuration>
【讨论】:
问题的第一部分可以通过访问以下菜单来解决 - 运行 -> 运行|调试配置 -> 您的配置 -> '参数' 选项卡 -> 虚拟机参数。将以下行添加到文本区域:
-Dorg.uncommons.reportng.escape-output=false
第二个问题,参考TestNG Ant documentation:
<testng>
<sysproperty key="org.uncommons.reportng.escape-output" value="false"/>
<!-- the rest of your target -->
</testng>
【讨论】: