Category:
TestNG
Using groups attribute in TestNG, we can assign the test methods to different groups.
//Test method belonging to sanity suite only
@Test(groups = {“sanitySuite”})
public void testMethod1() {
//Test logic
}
//Test method belonging to both sanity and regression suite
@Test(groups = {“sanitySuite”, “regressionSuite”})
public void testMethod2() {
//Test logic
}