Not able to execute test suite through build.xml


I have designed the Hybrid framework as mentioned on the site for E commerce domain website using Testng. My testsuite is running successfully if I am executing it through testng.xml. But when I am trying to integrate it with ant and run the suite through command line my init, compile tasks are executed successfully and when I am trying to execute run task it is showing me skipped status without running any test cases.
Below is the build.xml. Please help

Not able to execute test suite through build.xml

Build.xml :

<?xml version=”1.0″ encoding=”UTF-8″?>
<project name=”OonlineStore” default=”Run” basedir=”.”>
<property name=”src.dir” value=”${basedir}/src”/>
<property name=”build.dir” value=”${basedir}/build”/>
<property name=”testng_output.dir” value=”${basedir}/testng_output”/>

<property name=”LIB” value=”${basedir}/lib” />
<property name=”BIN” value=”${basedir}/bin” />
<path id=”master-classpath”>
<pathelement location=”${BIN}” />
<fileset dir=”${LIB}”>
<include name=”**/*.jar” />

<!– get class path, used for build –>
<property name=”lib.dir” value=”${basedir}/lib”/>
<path id=”classpath”>
<fileset dir=”${lib.dir}” includes=”*.jar”/>
<pathelement location=”build”/>

<!– create build folder, testng_output folder and remove old log file –>
<target name=”init”>
<delete dir=”${build.dir}”/>
<delete dir=”${testng_output}”/>
<delete dir=”${basedir}/testng-xslt”/>
<mkdir dir=”${build.dir}”/>
<mkdir dir=”${basedir}/testng-xslt”/>
<mkdir dir=”${testng_output.dir}”/>


<!– build all java file to class binary –>
<target name=”compile” depends=”init”>
<javac srcdir=”${basedir}/src” destdir=”${basedir}/build” classpathref=”classpath” includeantruntime=”false”>
<compilerarg value=”-Xlint:unchecked”/>

<!– Config for testng –>
<taskdef name=”testng” classname=”org.testng.TestNGAntTask”>
<pathelement location=”lib/testng-6.8.5.jar”/>

<!– execute testng after compile, then generate report –>
<target name =”Run” depends=”compile”>

<!– config testng –>
<testng outputdir=”${testng_output.dir}” classpathref=”classpath” useDefaultListeners=”true”>

<!– execute testcase follow testng.xml –>
<xmlfileset dir=”.” includes=”testng.xml”/>

<!– generate report title –>
<sysproperty key=”org.uncommons.reportng.title” value=”Test Automation”/>
<sysproperty key=”org.uncommons.reportng.escape-output” value=”false”/>

<target name=”xslt” depends=”Run”>

<xslt in=”${basedir}/testng_output/testng-results.xml” style=”${basedir}/testng-results.xsl” out=”${basedir}/testng-xslt/index.html” processor=”SaxonLiaison”>

<param expression=”${basedir}/testng-xslt/” name=”testNgXslt.outputDir” />

<param expression=”true” name=”testNgXslt.sortTestCaseLinks” />

<param expression=”FAIL,SKIP,PASS,CONF,BY_CLASS” name=”testNgXslt.testDetailsFilter” />

<param expression=”true” name=”testNgXslt.showRuntimeTotals” />

<classpath refid=”master-classpath”>


Default Asked on August 25, 2015 in Selenium WebDriver.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.