To group test cases in TestNG, you can use the “groups” attribute in the @Test annotation. Assign a group name to each test case, and then create a testng.xml file to include or exclude specific groups from the test run. You can also use the “include” or “exclude” tags to specify which test groups to include or exclude from the test run.
Groups can be created on the testng.xml file as shown below
The created groups then can be added to the tests.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article