Skip to main content
Tweeted twitter.com/StackSQA/status/819273139549065216
grammar, spelling, change to numerals in the description (leave digits for priorities)
Source Link

How does TestNG priority workswork for a group?

Suppose I have 5five test cases out of which 3three are grouped in "Smoke Testing" and 2two have not been grouped at all. 

If I have set priority for all my test cases startingfrom 1 to 5, will the cases from smoke testing group be evoked in priority?

@Test (priority=3, groups={"Smoke Testing"})
p v Test1(){}
@Test (priority=1, groups={"Smoke Testing"})
p v Test2(){}
@Test (priority=2, groups={"Smoke Testing"})
p v Test3(){}
@Test (priority=5)
p v Test4(){}
@Test (priority=4)
p v Test5(){}

What will happen if I want to add another group XYZ and added test cases like:

    @Test (priority=2, groups={"XYZ"})
    p v Test6(){}
    @Test (priority=1, groups={"XYZ"})
    p v Test7(){}

How does TestNG priority works for a group

Suppose I have 5 test cases out of which 3 are grouped in "Smoke Testing" and 2 have not been grouped at all. If I have set priority for all my test cases starting 1 to 5, will cases from smoke testing group be evoked in priority?

@Test (priority=3, groups={"Smoke Testing"})
p v Test1(){}
@Test (priority=1, groups={"Smoke Testing"})
p v Test2(){}
@Test (priority=2, groups={"Smoke Testing"})
p v Test3(){}
@Test (priority=5)
p v Test4(){}
@Test (priority=4)
p v Test5(){}

What will happen if I want to add another group XYZ and added test cases like:

    @Test (priority=2, groups={"XYZ"})
    p v Test6(){}
    @Test (priority=1, groups={"XYZ"})
    p v Test7(){}

How does TestNG priority work for a group?

Suppose I have five test cases out of which three are grouped in "Smoke Testing" and two have not been grouped at all. 

If I have set priority for all my test cases from 1 to 5, will the cases from smoke testing group be evoked in priority?

@Test (priority=3, groups={"Smoke Testing"})
p v Test1(){}
@Test (priority=1, groups={"Smoke Testing"})
p v Test2(){}
@Test (priority=2, groups={"Smoke Testing"})
p v Test3(){}
@Test (priority=5)
p v Test4(){}
@Test (priority=4)
p v Test5(){}

What will happen if I want to add another group XYZ and added test cases like:

@Test (priority=2, groups={"XYZ"})
p v Test6(){}
@Test (priority=1, groups={"XYZ"})
p v Test7(){}
modified code
Source Link
Bharat Mane
  • 6.8k
  • 11
  • 41
  • 69

Suppose I have 5 test cases out of which 3 are grouped in "Smoke Testing" and 2 have not been grouped at all. If I have set priority for all my test cases starting 1 to 5, will cases from smoke testing group be evoked in priority?

@Test (priority=3, groups={"Smoke Testing"})
p v Test1(){}
@Test (priority=1, groups={"Smoke Testing"})
p v Test2(){}
@Test (priority=2, groups={"Smoke Testing"})
p v Test3(){}
@Test (priority=5)
p v Test4(){}
@Test (priority=4)
p v Test5(){}
 
What will happen if we add another group XYZ

What will happen if I want to add another group XYZ and added test cases like:

 and add cases like
@Test (priority=2, groups={"XYZ"})
    p v Test6(){}
    @Test (priority=1, groups={"XYZ"})
    p v Test7(){}

Suppose I have 5 test cases out of which 3 are grouped in "Smoke Testing" and 2 have not been grouped at all. If I have set priority for all my test cases starting 1 to 5, will cases from smoke testing group be evoked in priority?

@Test (priority=3, groups={"Smoke Testing"})
p v Test1(){}
@Test (priority=1, groups={"Smoke Testing"})
p v Test2(){}
@Test (priority=2, groups={"Smoke Testing"})
p v Test3(){}
@Test (priority=5)
p v Test4(){}
@Test (priority=4)
p v Test5(){}
 
What will happen if we add another group XYZ and add cases like
@Test (priority=2, groups={"XYZ"})
p v Test6(){}
@Test (priority=1, groups={"XYZ"})
p v Test7(){}

Suppose I have 5 test cases out of which 3 are grouped in "Smoke Testing" and 2 have not been grouped at all. If I have set priority for all my test cases starting 1 to 5, will cases from smoke testing group be evoked in priority?

@Test (priority=3, groups={"Smoke Testing"})
p v Test1(){}
@Test (priority=1, groups={"Smoke Testing"})
p v Test2(){}
@Test (priority=2, groups={"Smoke Testing"})
p v Test3(){}
@Test (priority=5)
p v Test4(){}
@Test (priority=4)
p v Test5(){}

What will happen if I want to add another group XYZ and added test cases like:

    @Test (priority=2, groups={"XYZ"})
    p v Test6(){}
    @Test (priority=1, groups={"XYZ"})
    p v Test7(){}
modified code
Source Link
Bharat Mane
  • 6.8k
  • 11
  • 41
  • 69

Suppose I have 5 test cases out of which 3 are grouped in "Smoke Testing" and 2 have not been grouped at all. If I have set priority for all my test cases starting 1 to 5, will cases from smoke testing group be evoked in priority?

@Test (priority=3, groups={"Smoke Testing"}) p v Test1(){} @Test (priority=1, groups={"Smoke Testing"}) p v Test2(){} @Test (priority=2, groups={"Smoke Testing"}) p v Test3(){} @Test (priority=5) p v Test4(){} @Test (priority=4) p v Test5(){}

What will happen if we add another group XYZ and add cases like @Test (priority=2, groups={"XYZ"}) p v Test6(){} @Test (priority=1, groups={"XYZ"}) p v Test7(){}

@Test (priority=3, groups={"Smoke Testing"})
p v Test1(){}
@Test (priority=1, groups={"Smoke Testing"})
p v Test2(){}
@Test (priority=2, groups={"Smoke Testing"})
p v Test3(){}
@Test (priority=5)
p v Test4(){}
@Test (priority=4)
p v Test5(){}

What will happen if we add another group XYZ and add cases like
@Test (priority=2, groups={"XYZ"})
p v Test6(){}
@Test (priority=1, groups={"XYZ"})
p v Test7(){}

Suppose I have 5 test cases out of which 3 are grouped in "Smoke Testing" and 2 have not been grouped at all. If I have set priority for all my test cases starting 1 to 5, will cases from smoke testing group be evoked in priority?

@Test (priority=3, groups={"Smoke Testing"}) p v Test1(){} @Test (priority=1, groups={"Smoke Testing"}) p v Test2(){} @Test (priority=2, groups={"Smoke Testing"}) p v Test3(){} @Test (priority=5) p v Test4(){} @Test (priority=4) p v Test5(){}

What will happen if we add another group XYZ and add cases like @Test (priority=2, groups={"XYZ"}) p v Test6(){} @Test (priority=1, groups={"XYZ"}) p v Test7(){}

Suppose I have 5 test cases out of which 3 are grouped in "Smoke Testing" and 2 have not been grouped at all. If I have set priority for all my test cases starting 1 to 5, will cases from smoke testing group be evoked in priority?

@Test (priority=3, groups={"Smoke Testing"})
p v Test1(){}
@Test (priority=1, groups={"Smoke Testing"})
p v Test2(){}
@Test (priority=2, groups={"Smoke Testing"})
p v Test3(){}
@Test (priority=5)
p v Test4(){}
@Test (priority=4)
p v Test5(){}

What will happen if we add another group XYZ and add cases like
@Test (priority=2, groups={"XYZ"})
p v Test6(){}
@Test (priority=1, groups={"XYZ"})
p v Test7(){}
Source Link
NiNa
  • 31
  • 1
  • 3
Loading