I m using Eclipse + Selenium WebDriver + TestNG
This is my class structure :
class1
{
@test (invocation count =4)
method1()
@test (invocation count =4)
You can also use "priority" of TestNG as:
@Test(priority = -19)
public void testMethod1(){
//some code
}
@Test(priority = -20)
public void testMethod2(){
//some code
}
[Note: The priority for this test method. Lower priorities will be scheduled first]
So, in the above example testMethod2 will be executed first as -20 less than -19
You can visit for more details: http://testng.org/doc/documentation-main.html#annotations