No suites, classes, methods or jar file was specified

classic Classic list List threaded Threaded
8 messages Options
SG
Reply | Threaded
Open this post in threaded view
|

No suites, classes, methods or jar file was specified

SG
Hello,

I have written a sample selenium project using testng and ant. When i try to run it it is showing error.
It is giving error as "No suites, classes, methods or jar file was specified"

Please find the details below:

TestNG.xml:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Sample suite">

<test name="Login">
    <classes>
        <class name="AntSample1.SampleTestCase1"></class>
    </classes>
</test>

</suite>

Build.xml:

<?xml version="1.0" encoding="UTF-8"?>

 

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

    

    <property environment="env"/>

<property name="ws.home" value="C:/workspace/TestNGwithANTSample"/>

<property name="ws.jars" value="C:/jars"/>

     <property name="test.dest" value="${ws.home}/Build"/>

 

<property name="test.src" value="C:/workspace/TestNGwithANTSample/src"/>

 

     <property name="ng.result" value="test-output"/>

 

     <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 resource="testngtasks">

                <classpath>

                     <pathelement path="C:/eclipse/plugins/org.testng.eclipse_6.8.6.20141201_2240/lib/testng.jar"/>

                </classpath>

           </taskdef>

          

     </target>

    

     <target name="all">

     </target>

    

     <target name="clean">

    <delete dir="${test.dest}"/>

     </target>

 

     <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}"

           includeantruntime = "false"

           srcdir="${test.src}"

           target="1.7"

           classpath="${test.classpath}"

     >

     </javac>

     </target>

    

    

     <target name="build" depends="init">

     </target>

    

     <target name="run" depends="compile">

     <testng outputdir="${ws.home}/test-output"

     classpath="${test.classpath}:${test.dest}" suitename= "Sample suite">

     <xmlfileset dir="${ws.home}" includes="testng.xml"/>

     </testng>

     </target>

    

     <target name="usage">

           <echo>

                ant run exceute

           </echo>

     </target>

          

          

     <path id="test.c">

           <fileset dir="${ws.jar}" includes="*.jar"/>

     </path>

 

     <target name="makexsltreports">

         <mkdir dir="${ws.home}/XSLT_Reports/output"/>

         <xslt in="${ng.result}/testng-results.xml" style="src/com/testing/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>

 

</project>

 

 Build is successful when it is compiling.

Error at line 72 "No suites, classes, methods or jar file was specified"

Line 72 is      classpath="${test.classpath}:${test.dest}" suitename= "Sample suite">


Please help me.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: No suites, classes, methods or jar file was specified

Panikera
Hi Sowjanya
 
Pls try with this...

<target

name="run" depends="compile">

<testng

classpath="${test.classpath}:${test.dest}" >

<

xmlfileset dir="${ws.home}" includes="testng.xml"/>    
 </testng>
Regards,
Panikera
 
On Thu, Feb 13, 2014 at 9:43 PM, SG <[hidden email]> wrote:
Hello,

I have written a sample selenium project using testng and ant. When i try to run it it is showing error.
It is giving error as "No suites, classes, methods or jar file was specified"

Please find the details below:

TestNG.xml:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Sample suite">

<test name="Login">
    <classes>
        <class name="AntSample1.SampleTestCase1"></class>
    </classes>
</test>

</suite>

Build.xml:

<?xml version="1.0" encoding="UTF-8"?>

 

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

    

    <property environment="env"/>

<property name="ws.home" value="C:/workspace/TestNGwithANTSample"/>

<property name="ws.jars" value="C:/jars"/>

     <property name="test.dest" value="${ws.home}/Build"/>

 

<property name="test.src" value="C:/workspace/TestNGwithANTSample/src"/>

 

     <property name="ng.result" value="test-output"/>

 

     <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 resource="testngtasks">

                <classpath>

                     <pathelement path="C:/eclipse/plugins/org.testng.eclipse_6.8.6.20141201_2240/lib/testng.jar"/>

                </classpath>

           </taskdef>

          

     </target>

    

     <target name="all">

     </target>

    

     <target name="clean">

    <delete dir="${test.dest}"/>

     </target>

 

     <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}"

           includeantruntime = "false"

           srcdir="${test.src}"

           target="1.7"

           classpath="${test.classpath}"

     >

     </javac>

     </target>

    

    

     <target name="build" depends="init">

     </target>

    

     <target name="run" depends="compile">

     <testng outputdir="${ws.home}/test-output"

     classpath="${test.classpath}:${test.dest}" suitename= "Sample suite">

     <xmlfileset dir="${ws.home}" includes="testng.xml"/>

     </testng>

     </target>

    

     <target name="usage">

           <echo>

                ant run exceute

           </echo>

     </target>

          

          

     <path id="test.c">

           <fileset dir="${ws.jar}" includes="*.jar"/>

     </path>

 

     <target name="makexsltreports">

         <mkdir dir="${ws.home}/XSLT_Reports/output"/>

         <xslt in="${ng.result}/testng-results.xml" style="src/com/testing/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>

 

</project>

 

 Build is successful when it is compiling.

Error at line 72 "No suites, classes, methods or jar file was specified"

Line 72 is      classpath="${test.classpath}:${test.dest}" suitename= "Sample suite">


Please help me.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/groups/opt_out.
SG
Reply | Threaded
Open this post in threaded view
|

Re: No suites, classes, methods or jar file was specified

SG
In reply to this post by SG
Hello Panikera,

Thanks for your reply. I have tried but still i am getting the error.

BUILD FAILED
C:\....\build.xml:76: Problem: failed to create task or type testng
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

Please let me know how i can modify it?

Thanks,
GS


On Thursday, February 13, 2014 9:43:28 PM UTC+5:30, SG wrote:
Hello,

I have written a sample selenium project using testng and ant. When i try to run it it is showing error.
It is giving error as "No suites, classes, methods or jar file was specified"

Please find the details below:

TestNG.xml:
<!DOCTYPE suite SYSTEM "<a href="http://testng.org/testng-1.0.dtd" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\46sa\75D\46sntz\0751\46usg\75AFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\46sa\75D\46sntz\0751\46usg\75AFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA';return true;">http://testng.org/testng-1.0.dtd">
<suite name="Sample suite">

<test name="Login">
    <classes>
        <class name="AntSample1.SampleTestCase1"></class>
    </classes>
</test>

</suite>

Build.xml:

<?xml version="1.0" encoding="UTF-8"?>

 

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

    

    <property environment="env"/>

<property name="ws.home" value="C:/workspace/TestNGwithANTSample"/>

<property name="ws.jars" value="C:/jars"/>

     <property name="test.dest" value="${ws.home}/Build"/>

 

<property name="test.src" value="C:/workspace/TestNGwithANTSample/src"/>

 

     <property name="ng.result" value="test-output"/>

 

     <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 resource="testngtasks">

                <classpath>

                     <pathelement path="C:/eclipse/plugins/org.testng.eclipse_6.8.6.20141201_2240/lib/testng.jar"/>

                </classpath>

           </taskdef>

          

     </target>

    

     <target name="all">

     </target>

    

     <target name="clean">

    <delete dir="${test.dest}"/>

     </target>

 

     <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}"

           includeantruntime = "false"

           srcdir="${test.src}"

           target="1.7"

           classpath="${test.classpath}"

     >

     </javac>

     </target>

    

    

     <target name="build" depends="init">

     </target>

    

     <target name="run" depends="compile">

     <testng outputdir="${ws.home}/test-output"

     classpath="${test.classpath}:${test.dest}" suitename= "Sample suite">

     <xmlfileset dir="${ws.home}" includes="testng.xml"/>

     </testng>

     </target>

    

     <target name="usage">

           <echo>

                ant run exceute

           </echo>

     </target>

          

          

     <path id="test.c">

           <fileset dir="${ws.jar}" includes="*.jar"/>

     </path>

 

     <target name="makexsltreports">

         <mkdir dir="${ws.home}/XSLT_Reports/output"/>

         <xslt in="${ng.result}/testng-results.xml" style="src/com/testing/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>

 

</project>

 

 Build is successful when it is compiling.

Error at line 72 "No suites, classes, methods or jar file was specified"

Line 72 is      classpath="${test.classpath}:${test.dest}" suitename= "Sample suite">


Please help me.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/groups/opt_out.
SG
Reply | Threaded
Open this post in threaded view
|

Re: No suites, classes, methods or jar file was specified

SG
In reply to this post by SG
Can anyone provide me the solution?

On Thursday, February 13, 2014 9:43:28 PM UTC+5:30, SG wrote:
Hello,

I have written a sample selenium project using testng and ant. When i try to run it it is showing error.
It is giving error as "No suites, classes, methods or jar file was specified"

Please find the details below:

TestNG.xml:
<!DOCTYPE suite SYSTEM "<a href="http://testng.org/testng-1.0.dtd" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\46sa\75D\46sntz\0751\46usg\75AFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\46sa\75D\46sntz\0751\46usg\75AFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA';return true;">http://testng.org/testng-1.0.dtd">
<suite name="Sample suite">

<test name="Login">
    <classes>
        <class name="AntSample1.SampleTestCase1"></class>
    </classes>
</test>

</suite>

Build.xml:

<?xml version="1.0" encoding="UTF-8"?>

 

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

    

    <property environment="env"/>

<property name="ws.home" value="C:/workspace/TestNGwithANTSample"/>

<property name="ws.jars" value="C:/jars"/>

     <property name="test.dest" value="${ws.home}/Build"/>

 

<property name="test.src" value="C:/workspace/TestNGwithANTSample/src"/>

 

     <property name="ng.result" value="test-output"/>

 

     <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 resource="testngtasks">

                <classpath>

                     <pathelement path="C:/eclipse/plugins/org.testng.eclipse_6.8.6.20141201_2240/lib/testng.jar"/>

                </classpath>

           </taskdef>

          

     </target>

    

     <target name="all">

     </target>

    

     <target name="clean">

    <delete dir="${test.dest}"/>

     </target>

 

     <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}"

           includeantruntime = "false"

           srcdir="${test.src}"

           target="1.7"

           classpath="${test.classpath}"

     >

     </javac>

     </target>

    

    

     <target name="build" depends="init">

     </target>

    

     <target name="run" depends="compile">

     <testng outputdir="${ws.home}/test-output"

     classpath="${test.classpath}:${test.dest}" suitename= "Sample suite">

     <xmlfileset dir="${ws.home}" includes="testng.xml"/>

     </testng>

     </target>

    

     <target name="usage">

           <echo>

                ant run exceute

           </echo>

     </target>

          

          

     <path id="test.c">

           <fileset dir="${ws.jar}" includes="*.jar"/>

     </path>

 

     <target name="makexsltreports">

         <mkdir dir="${ws.home}/XSLT_Reports/output"/>

         <xslt in="${ng.result}/testng-results.xml" style="src/com/testing/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>

 

</project>

 

 Build is successful when it is compiling.

Error at line 72 "No suites, classes, methods or jar file was specified"

Line 72 is      classpath="${test.classpath}:${test.dest}" suitename= "Sample suite">


Please help me.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: No suites, classes, methods or jar file was specified

Yevhen Bilevych
Just googled for a subject and got few links

https://groups.google.com/forum/#!topic/selenium-users/6Sk43hmWLyg
https://groups.google.com/forum/#!topic/selenium-users/KhdYmBqw99U

Note that first link contains the solution to your exact ant build script.

Yevhen

On 02/19/2014 01:23 PM, SG wrote:

> Can anyone provide me the solution?
>
> On Thursday, February 13, 2014 9:43:28 PM UTC+5:30, SG wrote:
>
>     Hello,
>
>     I have written a sample selenium project using testng and ant. When
>     i try to run it it is showing error.
>     It is giving error as "No suites, classes, methods or jar file was
>     specified"
>
>     Please find the details below:
>
>     TestNG.xml:
>     <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd
>     <http://testng.org/testng-1.0.dtd>">
>     <suite name="Sample suite">
>
>     <test name="Login">
>         <classes>
>             <class name="AntSample1.SampleTestCase1"></class>
>         </classes>
>     </test>
>
>     </suite>
>
>     Build.xml:
>
>     <?xml version="1.0" encoding="UTF-8"?>
>
>      
>
>     <projectname="Selenium_MarketPoint"default="usage"basedir=".">
>
>        
>
>         <propertyenvironment="env"/>
>
>     <propertyname="ws.home"value="C:/workspace/TestNGwithANTSample"/>
>
>     <propertyname="ws.jars"value="C:/jars"/>
>
>          <propertyname="test.dest"value="${ws.home}/Build"/>
>
>      
>
>     <propertyname="test.src"value="C:/workspace/TestNGwithANTSample/src"/>
>
>      
>
>          <propertyname="ng.result"value="test-output"/>
>
>      
>
>          <targetname="setClassPath"unless="test.classpath">
>
>                <pathid="classpath_jars">
>
>         <filesetdir="${ws.jars}"includes="*.jar*"/>
>
>         </path>
>
>                <pathconvertpathsep=":"
>
>                     property="test.classpath"
>
>                     refid="classpath_jars"/>
>
>          </target>
>
>        
>
>          <targetname="init"depends="setClassPath">
>
>                <tstamp>
>
>                     <formatproperty="start.time"pattern="MM/dd/yyyy
>     hh:mm:aa"/>
>
>                </tstamp>
>
>                <conditionproperty="ANT"
>
>                     value="${env.ANT_HOME}/bin/ant.bat"
>
>                     else="${env.ANT_HOME}/bin/ant">
>
>                          <osfamily="windows"/>
>
>                </condition>
>
>                <taskdefresource="testngtasks">
>
>                     <classpath>
>
>                        
>     <pathelementpath="C:/eclipse/plugins/org.testng.eclipse_6.8.6.20141201_2240/lib/testng.jar"/>
>
>                     </classpath>
>
>                </taskdef>
>
>              
>
>          </target>
>
>        
>
>          <targetname="all">
>
>          </target>
>
>        
>
>          <targetname="clean">
>
>         <deletedir="${test.dest}"/>
>
>          </target>
>
>      
>
>          <targetname="compile"depends="init, clean">
>
>                <deleteincludeemptydirs="true"quiet="true">
>
>                     <filesetdir="${test.dest}"includes="**/*"/>
>
>          </delete>
>
>          <echomessage="making directory..."/>
>
>         <mkdirdir="${test.dest}"/>
>
>          <echomessage="classpath---------:${test.classpath}"/>
>
>          <echomessage="compiling......."/>
>
>          <javac
>
>                debug="true"
>
>                destdir="${test.dest}"
>
>                includeantruntime="false"
>
>                srcdir="${test.src}"
>
>                target="1.7"
>
>                classpath="${test.classpath}"
>
>          >
>
>          </javac>
>
>          </target>
>
>        
>
>        
>
>          <targetname="build"depends="init">
>
>          </target>
>
>        
>
>          <targetname="run"depends="compile">
>
>          <testngoutputdir="${ws.home}/test-output"
>
>          classpath="${test.classpath}:${test.dest}"suitename="Sample suite">
>
>          <xmlfilesetdir="${ws.home}"includes="testng.xml"/>
>
>          </testng>
>
>          </target>
>
>        
>
>          <targetname="usage">
>
>                <echo>
>
>                     ant run exceute
>
>                </echo>
>
>          </target>
>
>              
>
>              
>
>          <pathid="test.c">
>
>                <filesetdir="${ws.jar}"includes="*.jar"/>
>
>          </path>
>
>      
>
>          <targetname="makexsltreports">
>
>              <mkdirdir="${ws.home}/XSLT_Reports/output"/>
>
>            
>     <xsltin="${ng.result}/testng-results.xml"style="src/com/testing/xslt/testng-results.xsl"
>
>              
>     out="${ws.home}/XSLT_Reports/output/index.html"classpathref="test.c"processor="SaxonLiaison">
>
>                
>     <paramname="testNgXslt.outputDir"expression="${ws.home}/XSLT_Reports/output/"/>
>
>                 <paramname="testNgXslt.showRuntimeTotals"expression="true"/>
>
>               </xslt>
>
>         </target>
>
>      
>
>     </project>
>
>      
>
>      Build is successful when it is compiling.
>
>     Error at line 72 "No suites, classes, methods or jar file was specified"
>
>     Line 72
>     is      classpath="${test.classpath}:${test.dest}" suitename= "Sample suite">
>
>
>     Please help me.
>
> --
> You received this message because you are subscribed to the Google
> Groups "testng-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email].
> To post to this group, send email to [hidden email].
> Visit this group at http://groups.google.com/group/testng-users.
> For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: No suites, classes, methods or jar file was specified

Shetty Br
In reply to this post by SG
Hi,

As per your mail, test suite are detailed in TestNG.xml
TestNG.xml should be placed directly under the path "C:/workspace/TestNGwithANTSample" in Package explorer of Eclipse. 
I think error "no suites classes methods or jar file was specified" may not appear then.

Regards,
Rashmi

On Thursday, February 13, 2014 9:43:28 PM UTC+5:30, SG wrote:
Hello,

I have written a sample selenium project using testng and ant. When i try to run it it is showing error.
It is giving error as "No suites, classes, methods or jar file was specified"

Please find the details below:

TestNG.xml:
<!DOCTYPE suite SYSTEM "<a href="http://testng.org/testng-1.0.dtd" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\46sa\75D\46sntz\0751\46usg\75AFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\46sa\75D\46sntz\0751\46usg\75AFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA';return true;">http://testng.org/testng-1.0.dtd">
<suite name="Sample suite">

<test name="Login">
    <classes>
        <class name="AntSample1.SampleTestCase1"></class>
    </classes>
</test>

</suite>

Build.xml:

<?xml version="1.0" encoding="UTF-8"?>

 

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

    

    <property environment="env"/>

<property name="ws.home" value="C:/workspace/TestNGwithANTSample"/>

<property name="ws.jars" value="C:/jars"/>

     <property name="test.dest" value="${ws.home}/Build"/>

 

<property name="test.src" value="C:/workspace/TestNGwithANTSample/src"/>

 

     <property name="ng.result" value="test-output"/>

 

     <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 resource="testngtasks">

                <classpath>

                     <pathelement path="C:/eclipse/plugins/org.testng.eclipse_6.8.6.20141201_2240/lib/testng.jar"/>

                </classpath>

           </taskdef>

          

     </target>

    

     <target name="all">

     </target>

    

     <target name="clean">

    <delete dir="${test.dest}"/>

     </target>

 

     <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}"

           includeantruntime = "false"

           srcdir="${test.src}"

           target="1.7"

           classpath="${test.classpath}"

     >

     </javac>

     </target>

    

    

...

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: No suites, classes, methods or jar file was specified

Shetty Br
In reply to this post by SG
Hi GS,

In the Build.xml; please comment the section

<!--
    <classpath>
                           <path refid = "properties" />
                          <pathelement location = "${ws.home}/build" />
    </classpath>  
-->

And now check the output. You will not get the below issue:-
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

Regards,
Rashmi

On Saturday, February 15, 2014 10:13:49 AM UTC+5:30, SG wrote:
Hello Panikera,

Thanks for your reply. I have tried but still i am getting the error.

BUILD FAILED
C:\....\build.xml:76: Problem: failed to create task or type testng
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

Please let me know how i can modify it?

Thanks,
GS


On Thursday, February 13, 2014 9:43:28 PM UTC+5:30, SG wrote:
Hello,

I have written a sample selenium project using testng and ant. When i try to run it it is showing error.
It is giving error as "No suites, classes, methods or jar file was specified"

Please find the details below:

TestNG.xml:
<!DOCTYPE suite SYSTEM "<a href="http://testng.org/testng-1.0.dtd" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\46sa\75D\46sntz\0751\46usg\75AFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\46sa\75D\46sntz\0751\46usg\75AFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA';return true;">http://testng.org/testng-1.0.dtd">
<suite name="Sample suite">

<test name="Login">
    <classes>
        <class name="AntSample1.SampleTestCase1"></class>
    </classes>
</test>

</suite>

Build.xml:

<?xml version="1.0" encoding="UTF-8"?>

 

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

    

    <property environment="env"/>

<property name="ws.home" value="C:/workspace/TestNGwithANTSample"/>

<property name="ws.jars" value="C:/jars"/>

     <property name="test.dest" value="${ws.home}/Build"/>

 

<property name="test.src" value="C:/workspace/TestNGwithANTSample/src"/>

 

     <property name="ng.result" value="test-output"/>

 

     <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 resource="testngtasks">

                <classpath>

                     <pathelement path="C:/eclipse/plugins/org.testng.eclipse_6.8.6.20141201_2240/lib/testng.jar"/>

                </classpath>

           </taskdef>

          

     </target>

    

     <target name="all">

     </target>

    

     <target name="clean">

    <delete dir="${test.dest}"/>

     </target>

 

     <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}"

           includeantruntime = "false"

           srcdir="${test.src}"

           target="1.7"

           classpath="${test.classpath}"

     >

     </javac>

     </target>

    

    

     <target name="build" depends="init">

     </target>

    

     <target name="run"

...

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: No suites, classes, methods or jar file was specified

Raghu veer
In reply to this post by SG
include  <classpath refid="classpath_jars"/>  in between the <javac> target @ compile it worked for me.



On Thursday, February 13, 2014 at 9:43:28 PM UTC+5:30, SG wrote:
Hello,

I have written a sample selenium project using testng and ant. When i try to run it it is showing error.
It is giving error as "No suites, classes, methods or jar file was specified"

Please find the details below:

TestNG.xml:
<!DOCTYPE suite SYSTEM "<a href="http://testng.org/testng-1.0.dtd" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\46sa\75D\46sntz\0751\46usg\75AFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Ftestng.org%2Ftestng-1.0.dtd\46sa\75D\46sntz\0751\46usg\75AFQjCNFHihXzQ1YlwcxcDehnw97TuniFLA';return true;">http://testng.org/testng-1.0.dtd">
<suite name="Sample suite">

<test name="Login">
    <classes>
        <class name="AntSample1.SampleTestCase1"></class>
    </classes>
</test>

</suite>

Build.xml:

<?xml version="1.0" encoding="UTF-8"?>

 

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

    

    <property environment="env"/>

<property name="ws.home" value="C:/workspace/TestNGwithANTSample"/>

<property name="ws.jars" value="C:/jars"/>

     <property name="test.dest" value="${ws.home}/Build"/>

 

<property name="test.src" value="C:/workspace/TestNGwithANTSample/src"/>

 

     <property name="ng.result" value="test-output"/>

 

     <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 resource="testngtasks">

                <classpath>

                     <pathelement path="C:/eclipse/plugins/org.testng.eclipse_6.8.6.20141201_2240/lib/testng.jar"/>

                </classpath>

           </taskdef>

          

     </target>

    

     <target name="all">

     </target>

    

     <target name="clean">

    <delete dir="${test.dest}"/>

     </target>

 

     <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}"

           includeantruntime = "false"

           srcdir="${test.src}"

           target="1.7"

           classpath="${test.classpath}"

     >

     </javac>

     </target>

    

    

...

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.