eclipse - 如何使用 eclipse 在 testng 中设置 sysproperty?

标签 eclipse ant selenium testng reportng

我必须在 TestNG 中设置 'sysproperty key="org.uncommons.reportng.escape-output"value="false"/'。

  1. 让我知道如何使用 Eclipse 来完成此操作。
  2. 如果我无法使用 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/

相关文章:

eclipse - 如何在 BIRT Reporting for Eclipse 中安装 JDBC 驱动程序

java - 如何在 Cloud9 中运行 Maven 构建

java - Eclipse 提示 android 布局 xml 文件

java - 我如何在没有任何依赖项检查的情况下运行 gradle?

python - 如何在 Python 中将 while True 更改为 while False?

python - Pandas DataFrame 字符串中包含的 HTML

java - 修复 Eclipse 中的问题

java - 使用 ant 构建项目时包含 .properties 文件

Javadoc 与 Ant

jquery-ui - 测试页面上是否存在 jQuery UI 模式对话框或替代方案