The testNG file name should end with *Test i.e. RegistrationServiceTest.xml
In your ant file you have to specify the path of your testng.xml file in the testng tag.
There must be a similiar code fragment in your ant file as below in order to run TestNG based tests.
Test mechanism needs this declaration to find testng.xml.
You have to fill the <xmlfileset dir= property correctly.
<testng outputdir="output_directory_of_test_results"> ..... ..... ...... <xmlfileset dir="*****PATH OF testng.xml***" includes="testng.xml"/> </testng>
You can find an example of testng.xml below.
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" > <suite name="Tester" verbose="2" parallel="false"> <test name="Test Intact"> <classes> <class name="TestIntact"/> </classes> </test> </suite>
TestIntact is the class name which you write your tests.
I was succefully able to test it but..there starts another problem.
It returns me the error at the end ...
[testng] [WARNING]: No test suite found.Nothing to run.
Can anyone explain what exactly it means? and what should be done to solve this problem?
You must create a test suite in your *Test.xml
Go read the testng doc here: http://testng.org/doc/documentation-main.html
One example is as such:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="Suite1" verbose="1" > <test name="Regression1" > <packages> <package name="test.sample" /> </packages> </test> </suite>
I used the suite earlier but it was in right way....
so i modified it and it worked....
IS there any example(not a simple one as in TESTNG.org documentation) that shows how the results of a complex example something like real world application test results look like......