I\'m facing with the following problem: I created two classes which include @Tests with priority attribute:
@Test( priority = 1 )
public void testA1() {
Group the test methods of first class and put dependsOnGroups in test methods of 2nd class.So execution will be proper as per the expectation shown below
ClassOne is as follows
@Test( priority = 1,groups="FirstClass" )
public void testA1() {
System.out.println("testA1");
}
@Test( priority = 2,groups="FirstClass" )
public void testA2() {
System.out.println("testA2");
}
@Test( priority = 3,groups="FirstClass" )
public void testA3() {
System.out.println("testA3");
}
ClassTwo is as follows
@Test( priority = 1,dependsOnGroups="FirstClass")
public void testB1() {
System.out.println("testB1");
}
@Test( priority = 2,dependsOnGroups="FirstClass" )
public void testB2() {
System.out.println("testB2");
}
@Test( priority = 3,dependsOnGroups="FirstClass" )
public void testB3() {
System.out.println("testB3");
}
And Finally testng.xml is
It gives the same output as per priority given in both the classes and order also