Hi,
I am trying to make a parameterized Target for TestNG in ANT with aim to have desired "Attribute" passed from command line itself.
Sample from build.xml
<target name="test" depends="compile">
<echo message="${suiteXML}"/>
<echo message="${testGRP}"/>
<!-- TestNG Tag -->
<testng classpath="${test.classpath};${build.dir}" groups="${testGRP}">
<xmlfileset dir="${basedir}" includes="${suiteXML}" />
</testng>
</target>
Sample Commands
ant test -DsuiteXML=testng.xml
ant test -DsuiteXML=testng.xml, ABC.xml
ant test -DsuiteXML=testng.xml -DtestGRP=smoke
Please share if you have any sample code(for build xml file) available to consider only those attributes in TestNG Task which are passed as parameter/property from command line. Else those attributes should not be considered.
Something around how we can dynamically create TestNG Ant task.
Thanks,
Ashish