Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

How can we group test cases like separate test cases for Sanity suite, Regression suite, etc?

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
}

Leave a Reply

Your email address will not be published. Required fields are marked *