我必须在 TestNG 中设置 'sysproperty key="org.uncommons.reportng.escape-output"value="false"/'。
- 让我知道如何使用 Eclipse 来完成此操作。
- 如果我无法使用 eclipse 设置属性,请告诉我如何创建 TestNG ANT 任务。
提前致谢。
最佳答案
如果您不需要经常更改它,您还可以将其作为 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>
关于eclipse - 如何使用 eclipse 在 testng 中设置 sysproperty?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11957105/