testng build.xml error:No suites,classes,methods or jar file was pecified

2,195 views
Skip to first unread message

Suresh Reddy

unread,
Aug 21, 2012, 4:56:47 AM8/21/12
to seleniu...@googlegroups.com
I have the below build.xml and when i runt the tests it is throwing an error No suites,classes,methods or jar file was specified.It is working fine until the build and I can see the classes built.But when i run the tests its throwing an error.Please help me with this





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

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

<!-- ========== Initialize Properties =================================== -->
    <property environment="env"/>
   
    <property name="ws.home" value="${basedir}"/>
    <property name="ws.jars" value="C:\selenium server"/>
    <property name="test.dest" value="${ws.home}/build"/>
    <property name="test.src" value="${ws.home}/Settings_tests"/>
    <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="**/*.jar"/>
        </delete>
        <echo message="making directory..."/>
        <mkdir dir="${test.dest}"/>
        <echo message="classpath------: ${test.classpath}"/>
        <echo message="compiling..."/>
        <javac
            includeantruntime="false" 
            debug="true"
            destdir="${test.dest}"
            srcdir="${test.src}"
            target="1.7"
            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="testng-sequence.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>

Krishnan Mahadevan

unread,
Aug 21, 2012, 4:59:28 AM8/21/12
to seleniu...@googlegroups.com
http://testng.org/doc/ant.html 

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/




--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/fmfE-X_7WSMJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Mayank Srivastava

unread,
Jun 10, 2013, 10:15:39 AM6/10/13
to seleniu...@googlegroups.com
Hey Krishnan,

Can you please provide the specific point which we have to look on below URL?

Krishnan Mahadevan

unread,
Jun 10, 2013, 11:17:54 AM6/10/13
to Selenium Users
Mayank,
I am not conversant with ant. I use Maven. Which is why I gave you the reference link hoping that you would figure it out on your own.

Perhaps you might want to spend some time taking a look here : http://openwritings.net/public/testng/ant-build-file-testng


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/


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.

SOUVIK DUTTA

unread,
Dec 1, 2013, 3:33:03 PM12/1/13
to seleniu...@googlegroups.com
Hey Krishnan,

I am facing a same problem as described by, could you please let me know how did you solve this issue. My ant looks exactly like yours, please help.

Thanks
Souvik

Krishnan Mahadevan

unread,
Dec 12, 2013, 11:46:19 AM12/12/13
to seleniu...@googlegroups.com
Am not conversant with Ant. I am more familiar with Maven. Hope someone else would pitch in and offer help. 
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/4bc6bc24-5250-4686-a38b-3be042d50768%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


--

Sudheer Qa

unread,
May 26, 2015, 4:57:45 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.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages