"No suites, classes, methods or jar file was specified" in Ant TestNG

1,006 views
Skip to first unread message

Kishore Thotapally

unread,
Nov 15, 2014, 2:22:41 AM11/15/14
to seleniu...@googlegroups.com
Hi,

When am trying to running Ant TestNG am getting the following error message

"No suites, classes, methods or jar file was specified"

Could you please let me know the solustion.

Please find the screen shot

Inline image 1

Please find the Build.xml also

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE project [
]>

<project name="TestNG" default="usage" basedir=".">  

<!-- ========== Initialize Properties =================================== -->
    <property environment="env"/>
    
<property name="ws.home" value="D:\Eclipse\AntTestNG"/>
<property name="ws.jars" value="E:\jars\jars"/>
   <property name="test.dest" value="D:\Eclipse\AntTestNG/build"/>
   <property name="test.src" value="D:\Eclipse\AntTestNG/src"/>
<property name="ng.result" value="test-output"/>
    
    <!--target name="start-selenium-server">
        <java jar="${ws.home}/lib/selenium-server.jar"/>
    </target-->

    <target name="setClassPath" unless="test.classpath">
        <path id="classpath_jars">
            <fileset dir="${ws.jars}" includes="*.jar"/>
        </path>
        <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.5" 
            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="testing.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.c">
       <fileset dir="${ws.jars}" includes="*.jar"/>
</path>
 <target name="makexsltreports">
       <mkdir dir="${ws.home}/XSLT_Reports/output"/>

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

    <!-- ****************** targets not used ****************** -->
 
</project>

Regards,
Kishore

Kishore Thotapally

unread,
Nov 15, 2014, 5:41:01 AM11/15/14
to seleniu...@googlegroups.com
Any updates below issue solution

Regards,
Kishore

PeterJeffreyGale

unread,
Nov 15, 2014, 5:50:33 AM11/15/14
to seleniu...@googlegroups.com
It's not a Selenium question.

Try an Ant/TestNG forum if you expect an answer.

Kishore Thotapally

unread,
Nov 15, 2014, 6:05:15 AM11/15/14
to seleniu...@googlegroups.com
Can you please suggest Ant/TestNG forum mail id?


On Sat, Nov 15, 2014 at 4:20 PM, PeterJeffreyGale <peterjef...@hotmail.co.uk> wrote:
It's not a Selenium question.

Try an Ant/TestNG forum if you expect an answer.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/5511ff96-5671-4f70-bc81-3a1b44836273%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

PeterJeffreyGale

unread,
Nov 15, 2014, 6:08:28 AM11/15/14
to seleniu...@googlegroups.com
No.

Ravindra

unread,
Nov 17, 2014, 6:10:30 AM11/17/14
to seleniu...@googlegroups.com
Try posting this Question in TestNG users group:  https://groups.google.com/forum/#!forum/testng-users

Sudheer Qa

unread,
May 26, 2015, 5:01:20 AM5/26/15
to seleniu...@googlegroups.com
The resolution for this issue is explained clearly in this blogger. 

Please have a look at it.. 

http://tobeanexpert.blogspot.in/2015/05/generate-xslt-report-ant-buildxml.html

I hope this will helps you.. 

Thanks, 
sudheer.
Reply all
Reply to author
Forward
0 new messages