ANT Run Error | Selenium Forum
M
Posted on 23/08/2015
Hi All,
While running ANT (i.e. Ant Run)I got following error on screen

"No suites,classes,methods or Jar file was specified".

As Ashish told in the training

1. I created build.xml under project(added <property name="ws.jars" value="C:\\Jars"/>,target=1.8,suitename="Suite1",included selenium,JDK,jre,apache ANT,SaxonLiaison jarc in c:\\Jars)

2.testng.xml(given suite name as "Suite1")
3.Created xslt package(added testng_results.xsl)

Can anyone plz suggest where I went wrong ? Do I need to change any content in build.xml?

M
Replied on 24/08/2015

<javac srcdir="${src}"
destdir="${build}"
fork="yes"
executable="/opt/java/jdk1.8/bin/javac"
compiler="javac1.8"
/>

try this one, would you and report back the result.


M
Replied on 24/08/2015

Instead of "C:\\Jars"
use

C:\jars


M
Replied on 24/08/2015

Hi,
I have replaced the code
<javac
debug="true"
destdir="${test.dest}"
srcdir="${test.src}"
target="1.5"
classpath="${test.classpath}"
>
</javac>

in build.xml with


<javac srcdir="${src}"
destdir="${build}"
fork="yes"
executable="/opt/java/jdk1.8/bin/javac"
compiler="javac1.8"
/>



But still i am getting Same Error.I am attaching Build.xml and error file.


Thank you ,
Chaithanya.


M
Replied on 24/08/2015

what is the path of your

JAVA_HOME ?
PATH = %JAVA_HOME%\bin ?


M
Replied on 25/08/2015

Hi,

JAVA_HOME path is "C:\Program Files\Java\JDK"

jdk version 1.8.0_40


M
Replied on 25/08/2015

In command prompt when I am compiling using ant an error "taskdef class org.testng.TestNGAntTask cannot be found." is displaying.In build.xml file there is also eclipse displaying warning message for line "<taskdef name="testng" classpath="${test.classpath}"classname="org.testng.TestNGAntTask" /> ".What should I do to remove this issue? I have attached snapshots of this issue also for reference.I am watching now video9 so I have no idea to create build.xml file so here I have simply copy from code and paste in project as suggested by Ashish in video9.Please suggest me what and where should I do?

Responsive image

M
Replied on 25/08/2015

what is the error where it is giving yellow line.


M
Replied on 26/08/2015

In command prompt when I am compiling using ant an error "taskdef class org.testng.TestNGAntTask cannot be found." is displaying. Yellow line is displaying in line no. 38 and 39 of build.xml file I have used.


M
Replied on 26/08/2015

"taskdef class org.testng.TestNGAntTask cannot be found."

classpath cannot find testng jar file.


M
Replied on 26/08/2015

So what should I do? I need to configure TestNG jar file?


M
Replied on 26/08/2015

Then what is the solution? What should I do?


M
Replied on 27/08/2015

where is your ant file pointing to keep all the jar files there.