Eclipse + TestNG+Ant..confused
Hello, hope someone can help me.
1. I have Eclipse Kepler
2. It came with Ant
3. I set-up TestNG plugin for Eclipse
I created one class called 'CommonMethods' and second class 'TestCommonMethods'.
In my 'TestCommonMethods' class I am using TestNG annotations (just basic ones @BeforeTest, @Test, @AfterTest). I put @Test before a regular method and inside I specify what I want to test.
I can run separate methods annotated with @Test without problems.
I found a folder named 'test-output' in my project workspace which I guess was created by default by TestNG because I did not create it. Inside of 'test-output' I have 'default suite' folder which has 'default suite.html'.
So I can run a single @Test method and check the output in 'default suite.html'. Every time I run a test the 'default suite.html' gets over-ridden.
Where I am stuck:
1. I want to run not just one but multiple methods that have @Test annotation.
2. I want to know how I can keep results of running my tests so they don't get over-ridden.
3. I want to specify a folder for my test results (instead of 'test-output' I want to create a folder on my Desktop if it is possible).
I googled it and it looks like to run multiple methods I need to use Ant. I need to create a build.xml file.
So here are my questions:
1. I am really confused with build.xml for Ant projects and testng.xml.
What is the difference? I know they are both xml files:D: but it looks like I need to create Ant build.xml if I want to run 2 or more @Test methods, correct?
testng.xml ..what is it for? How would you use it?
2. In my Ant build.xml file I need to put this line
so I can run multiple @Test methods (that I have in one class) , correct?