2

TestNGで「syspropertykey="org.uncommons.reportng.escape-output" value ="false"/」を設定する必要があります。

  1. Eclipseを使用してそれを行う方法を教えてください。
  2. また、Eclipseを使用してプロパティを設定できない場合のTestNGANTタスクの作成方法を教えてください。

前もって感謝します。

4

2 に答える 2

2

頻繁に変更する必要がない場合は、pom.xmlのmaven-surefire-pluginにsyspropertyVariableとして追加することもできます。それ以外の場合は、前の回答のように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>
于 2013-06-14T08:41:34.023 に答える
1

質問の最初の部分は、次のメニューにアクセスすることで解決できます-実行->実行|構成のデバッグ->構成->'引数'タブ->VM引数。テキスト領域に次の行を追加します。

-Dorg.uncommons.reportng.escape-output=false

2番目の質問については、TestNGAntのドキュメントを参照してください。

<testng>
   <sysproperty key="org.uncommons.reportng.escape-output" value="false"/>
   <!-- the rest of your target -->
</testng>
于 2012-08-14T21:51:57.843 に答える