How to customize the order of execution of tests in TestNG?
For example:
public class Test1 {
@Test
public void test1() {
System.out.printl
In TestNG, you use dependsOnMethods and/or dependsOnGroups:
@Test(groups = "a")
public void f1() {}
@Test(groups = "a")
public void f2() {}
@Test(dependsOnGroups = "a")
public void g() {}
In this case, g() will only run after f1() and f2() have completed and succeeded.
You will find a lot of examples in the documentation: http://testng.org/doc/documentation-main.html#test-groups