Below code helps you to understand how to set test case priority in TestNG.
1
2
3
4
5
6
7
8
9
10
11
12
13
package TestNG;
import org.testng.annotations.*;
public class SettingPriority {
@Test(priority=0)
public void method1() {
}
@Test(priority=1)
public void method2() {
}
@Test(priority=2)
public void method3() {
}
}
Test Execution Sequence:
1
2
3
Method1
Method2
Method3