Question

My project has a jar in classpath with some utilities in it. When I run the program using ant on Red Hat linux, it's unable to read the system properties using System.getProperty(key), but it works perfectly fine when ran on Ubuntu.

Any suggestion to why this might be happening is appreciated.

ant target

<target name="test">
    <property environment="env"/>
    <echo message="PATH_ROOT set  =>  ${env.PATH_ROOT}" />
    <echo message="CUSTOM_REPORT_PATH set  =>  ${env.CUSTOM_REPORT_PATH}" />
    <testng classpathref="compile.classpath" haltOnfailure="false" outputDir="${testng.output.dir}/xxx">
        <sysproperty key="PATH_ROOT" value="${env.PATH_ROOT}"/>
        <sysproperty key="CUSTOM_REPORT_PATH" value="${env.CUSTOM_REPORT_PATH}"/>
        <xmlfileset dir="src/com/xxx" includes="suite.xml" />
    </testng>
</target>

================

Was it helpful?

Solution

Guys it was a silly mistake. The framework was not executing the file which had the statements to fetch system variables as the listener was missing in testng suite which is a must for testng to invoke that

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top