Run Project Using ANT | Selenium Forum
M
Posted on 09/10/2016
Hi Ashish,
I am trying to run a simple project using ANT. in which i am using only One Class name "NewLead.java". In but when i run through it ant it display [b:mqgr9vtm]"The test failed"[/b:mqgr9vtm] message.

In "NewLead.java" class write a code for create a new lead. I want to do it through ANT but not getting successful. so please suggest me where i am wrong.



[b:mqgr9vtm]Project & Screen shot attached [/b:mqgr9vtm]

[b:mqgr9vtm]Note:- [/b:mqgr9vtm] Please download the project and run it on you machine. I tried it many times but not success.

M
Replied on 10/10/2016

Any Update?


M
Replied on 10/10/2016

testng jar file is missing. add that to your jars folder.


M
Replied on 11/10/2016

Ashish,
TESTNG jars has been already added and it display also. Today i again run with ANT, on CMD it is not display any error and show
BUILD SUCCESSFUL but when i goto to the ZOHO site and check new created Lead, new Lead is not created.
There may be possibility in build.xml so please investigate it.

[b:3kiuer02]Project with xls sheet and Screen Shot attached[/b:3kiuer02]


D:\WorkspaceEclipse\BatchFilePractice>ant compile
Buildfile: D:\WorkspaceEclipse\BatchFilePractice\build.xml

setClassPath:

init:

clean:
[delete] Deleting directory D:\WorkspaceEclipse\BatchFilePractice\build

compile:
[echo] making directory...
[mkdir] Created dir: D:\WorkspaceEclipse\BatchFilePractice\build
[echo] classpath------: D:\jars\apache-mime4j-0.6.jar:D:\jars\bsh-2.0b4.jar
Responsive image:\jars\cglib-nodep-2.1_3.jar:D:\jars\commons-codec-1.10.jar:D:\jars\commons-co
llections-3.2.2.jar:D:\jars\commons-el-1.0.jar:D:\jars\commons-exec-1.3.jar:D:\j
ars\commons-io-2.4.jar:D:\jars\commons-lang3-3.4.jar:D:\jars\commons-logging-1.2
.jar:D:\jars\cssparser-0.9.16.jar:D:\jars\dom4j-1.1.jar:D:\jars\gson-2.3.1.jar:D
:\jars\guava-19.0.jar:D:\jars\hamcrest-core-1.3.jar:D:\jars\hamcrest-library-1.3
.jar:D:\jars\htmlunit-2.18.jar:D:\jars\htmlunit-core-js-2.17.jar:D:\jars\httpcli
ent-4.5.1.jar:D:\jars\httpcore-4.4.3.jar:D:\jars\httpmime-4.5.jar:D:\jars\jasper
-compiler-5.5.15.jar:D:\jars\jasper-compiler-jdt-5.5.15.jar:D:\jars\jasper-runti
me-5.5.15.jar:D:\jars\javax.servlet-api-3.1.0.jar:D:\jars\jcommander-1.48.jar:D:
\jars\jetty-continuation-9.2.13.v20150730.jar:D:\jars\jetty-http-9.2.13.v2015073
0.jar:D:\jars\jetty-io-9.2.13.v20150730.jar:D:\jars\jetty-jmx-9.2.13.v20150730.j
ar:D:\jars\jetty-security-9.2.13.v20150730.jar:D:\jars\jetty-server-9.2.13.v2015
0730.jar:D:\jars\jetty-servlet-9.2.13.v20150730.jar:D:\jars\jetty-servlets-9.2.1
3.v20150730.jar:D:\jars\jetty-util-9.2.13.v20150730.jar:D:\jars\jna-4.1.0.jar:D:
\jars\jna-platform-4.1.0.jar:D:\jars\jsp-api-2.0.jar:D:\jars\junit-4.12.jar:D:\j
ars\nekohtml-1.9.22.jar:D:\jars\netty-3.5.7.Final.jar:D:\jars\phantomjsdriver-1.
2.1.jar:D:\jars\poi-3.6-20091214.jar:D:\jars\poi-ooxml-3.6-20091214.jar:D:\jars\
poi-ooxml-schemas-3.6-20091214.jar:D:\jars\sac-1.3.jar:D:\jars\selenium-java-2.5
1.0.jar:D:\jars\serializer-2.7.2.jar:D:\jars\[b:3kiuer02][u:3kiuer02]testng-6.9.9.jar:[/u:3kiuer02][/b:3kiuer02]D:\jars\websocket-
api-9.2.13.v20150730.jar:D:\jars\websocket-client-9.2.13.v20150730.jar:D:\jars\w
ebsocket-common-9.2.13.v20150730.jar:D:\jars\xalan-2.7.2.jar:D:\jars\xercesImpl-
2.11.0.jar:D:\jars\xml-apis-1.4.01.jar:D:\jars\xmlbeans-2.3.0.jar
[echo] compiling...
[javac] D:\WorkspaceEclipse\BatchFilePractice\build.xml:67: warning: 'includ
eantruntime' was not set, defaulting to build.sysclasspath=last; set to false fo
r repeatable builds
[javac] Compiling 4 source files to D:\WorkspaceEclipse\BatchFilePractice\bu
ild
[javac]
[javac] WARNING
[javac]
[javac] The -source switch defaults to 1.7 in JDK 1.7.
[javac] If you specify -target 1.5 you now must also specify -source 1.5.
[javac] Ant will implicitly add -source 1.5 for you. Please change your bui
ld file.
[javac] warning: [options] bootstrap class path not set in conjunction with
-source 1.5
[javac] 1 warning

[b:3kiuer02]BUILD SUCCESSFUL
Total time: 2 seconds[/b:3kiuer02]

D:\WorkspaceEclipse\BatchFilePractice>

Responsive image

M
Replied on 11/10/2016

Please suggest.


M
Replied on 12/10/2016

have you looked at this error?

http://stackoverflow.com/questions/19521474/unable-to-run-testng-from-command-line

http://stackoverflow.com/questions/30435688/getting-java-lang-noclassdeffounderror-com-beust-jcommander-parameterexception


M
Replied on 14/10/2016

Done. thanks.