Not able to run the testng xml

4,166 views
Skip to first unread message

seleniuml...@gmail.com

unread,
Dec 1, 2013, 12:17:47 AM12/1/13
to testng...@googlegroups.com
Hi All,

    I am new for testng framework, I created one project and developed some test scripts using testng annotations,and I am able to run the testng.xml from the ecliplse as "TestNG suite"

but when i ran the same xml file from the command line it's not working. can any one suggest me on this how to implement the same

Can any one give me the sample project which can run the xml from the command line.


here i am getting the below exception when I ran the xml file from command line
F:\Web_Drive\TestngReports>java org.testng.TestNG testng.xml
Error: Could not find or load main class org.testng.TestNG

And i am little bit confusing which where i need to copy the testng.jar, testng.xml file inside "project" are inside the "src" folder please let me know


Help would be really appreciated

Regards,
Sunny.


seleniuml...@gmail.com

unread,
Dec 3, 2013, 10:45:28 AM12/3/13
to testng...@googlegroups.com
Hi,

Any one has idea about this

Regards,
Sunny

Manny

unread,
Dec 3, 2013, 6:09:55 PM12/3/13
to testng...@googlegroups.com
Quotes from TestNG documentation.

Assuming that you have TestNG in your class path, the simplest way to invoke TestNG is as follows:
java org.testng.TestNG testng1.xml

Make sure you have the classpath set properly. Example below.

 java -cp /Users/.../MyTest/dist/lib/*:/Users//MyTest/dist/MyTest.jar: org.testng.TestNG 

Selenium Learner

unread,
Dec 12, 2013, 11:49:16 AM12/12/13
to testng...@googlegroups.com

Hi All,
Please any one can share project which will run from the command line

Regards,
Sunny
,


--
You received this message because you are subscribed to a topic in the Google Groups "testng-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/testng-users/ARCN4Xocw7w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/groups/opt_out.

Selenium Learner

unread,
Dec 28, 2013, 11:08:23 AM12/28/13
to testng...@googlegroups.com
Hi All,

I am writing hear about my complete project

My TestNG project is saved under inside the workspace which is:

F:\Web_Drive\Testng

Testng jar is under: F:\Web_Drive\Testng\lib\

Testng xml is under: F:\Web_Drive\Testng

My class files is under: F:\Web_Drive\Testng\bin\test

And I set the classpath for testng.jar in environmet variable as: F:\Web_Drive\Testng\lib\

Here I used the below command for run the Testng.xml from command line as:

cd F:\Web_Drive\Testng
set prjpath=F:\Web_Drive\Testng
echo %prjpath%
set clspath=%prjpath%\bin\test;%prjpath%\lib\*
echo %clspath%
java org.test.TestNG %prjpath%Testng.xml

I am getting the below exception is as:
Error: Could not find or load main class org.test.TestNG



Please sujjest me on this i got struck here, Help would be greatly appreciated

Thanks In Advance


Regards,
Sunny

ybil...@gmail.com

unread,
Dec 28, 2013, 12:28:16 PM12/28/13
to testng...@googlegroups.com
You should use either environment variable CLASSPATH or java's command line option --classpath

Please consult with the java documentation.


Sent from my BlackBerry® PlayBook™
www.blackberry.com


From: "Selenium Learner" <seleniuml...@gmail.com>
To: "testng...@googlegroups.com" <testng...@googlegroups.com>
Sent: December 28, 2013 6:08 PM
Subject: Re: [testng-users] Re: Not able to run the testng xml
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 testng-users...@googlegroups.com.

Selenium Learner

unread,
Dec 28, 2013, 10:04:13 PM12/28/13
to testng...@googlegroups.com
Hi, Yevhen,
Where i can see the docs


Regards,
Sunny

Selenium Learner

unread,
Jan 20, 2014, 3:50:09 AM1/20/14
to testng...@googlegroups.com
Any update on this


Regards,
Sunny

ybil...@gmail.com

unread,
Jan 20, 2014, 4:14:26 AM1/20/14
to testng...@googlegroups.com

Sent from my BlackBerry® PlayBook™
www.blackberry.com


Sent: January 20, 2014 10:50 AM
Reply all
Reply to author
Forward
0 new messages