How to set sysproperty in testng using eclipse? How to set sysproperty in testng using eclipse? selenium selenium

How to set sysproperty in testng using eclipse?


You could also add It as a syspropertyVariable in your maven-surefire-plugin in your pom.xml, like so, if you don't need changing it often. Otherwise, use the VM arguments like in the previous answers.

<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>


The fist part of question could be addressed by accessing following menu - Run -> Run|Debug Configuration -> Your Configuration -> 'Arguments' tab -> VM arguments. Add following line to the text area:

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

For the second question, refer to TestNG Ant documentation:

<testng>   <sysproperty key="org.uncommons.reportng.escape-output" value="false"/>   <!-- the rest of your target --></testng>