ANT Error | Selenium Forum
J
Jeffrey Mensah-Roberts Posted on 21/01/2019
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE project [
]>

<project name="Rediff Hybrid" default="usage" basedir=".">  
<!-- ========== Initialize Properties =================================== -->
    <property environment="env"/>
    
    <property name="ws.home" value="${basedir}"/>
               <!--property name="ws.jars" value="C:\Users\jeffr\Desktop\Selenium"/-->
    <property name="test.dest" value="${ws.home}/build"/>
    <property name="test.src" value="${ws.home}/src"/>
               <property name="ng.result" value="test-output"/>
    
    <!--target name="start-selenium-server">
        <java jar="${ws.home}/lib/selenium-server.jar"/>
    </target-->
               <path id="classpath_jars">
                              <fileset dir="${user.home}/.m2/repository" includes="**/*.jar"/>
               </path>
    <target name="setClassPath" unless="test.classpath">
        
        <pathconvert pathsep=":" 
            property="test.classpath" 
            refid="classpath_jars"/>
    </target>

    <target name="init" depends="setClassPath">
        <tstamp>
            <format property="start.time" pattern="MM/dd/yyyy hh:mm aa" />
        </tstamp>
        <condition property="ANT" 
            value="${env.ANT_HOME}/bin/ant.bat" 
            else="${env.ANT_HOME}/bin/ant">
                    <os family="windows" />
        </condition>
        <taskdef name="testng" classpath="${test.classpath}"
               classname="org.testng.TestNGAntTask" />
    
    </target>
  
    <!-- all -->
    <target name="all">
    </target>

    <!-- clean -->
    <target name="clean">
        <delete dir="${test.dest}"/>
    </target>

    <!-- compile -->
    <target name="compile" depends="init, clean" > 
                              <delete includeemptydirs="true" quiet="true">
            <fileset dir="${test.dest}" includes="**/*"/>
                              </delete>
        <echo message="making directory..."/>
                              <mkdir dir="${test.dest}"/>
        <echo message="classpath------: ${test.classpath}"/>
        <echo message="compiling..."/>
        <javac 
            debug="true" 
            destdir="${test.dest}" 
            srcdir="${test.src}" 
            target="1.8.0_192" 
            classpath="${test.classpath}"
        >
        </javac>
      </target>

    <!-- build -->
    <target name="build" depends="init">
    </target>

    <!-- run -->
    <target name="run" depends="compile">
        <testng classpath="${test.classpath}:${test.dest}" suitename="suite1">           
            <xmlfileset dir="${ws.home}" includes="src/test/resources/testng.xml"/>
        </testng>
        <!--
        <testng classpath="${test.classpath}:${test.dest}" groups="fast">
            <classfileset dir="${test.dest}" includes="example1/*.class"/>
        </testng>
        -->
    </target>

    <target name="usage">
        <echo>
            ant run will execute the test
        </echo>
    </target>

               <path id="test.xslt">
                              <fileset dir="D:/Whizdom-Trainings/jars/saxon" includes="**/*.jar"/>
               </path>
               
                 <target name="makexsltreports">
                       <mkdir dir="${ws.home}/XSLT_Reports/output"/>

                       <xslt in="${ng.result}/testng-results.xml" style="src/test/resources/testng-results.xsl"
                             out="${ws.home}/XSLT_Reports/output/index.html" classpathref="test.xslt" processor="SaxonLiaison">
                           <param name="testNgXslt.outputDir" expression="${ws.home}/XSLT_Reports/output/"/>
                           <param name="testNgXslt.showRuntimeTotals" expression="true"/>
                       </xslt>
                   </target>

    <!-- ****************** targets not used ****************** -->
               <target name="email" >
                      <java classname="com.qtpselenium.rediff.hybrid.mail.ZipAndSendMail" classpath="${test.dest}" classpathref="classpath_jars" />
                   </target>
               
               <target name="run_parallel" >
                                     <java classname="com.qtpselenium.rediff.hybrid.base.ParallelExec" classpath="${test.dest}" classpathref="classpath_jars" />
                                  </target>
</project>

A
Ashish Thakur Replied on 23/01/2019

What issue are you facing?