O'Reilly logo

TestNg Beginner's Guide by Varun Menon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – including/excluding groups using the testng XML

Perform the following steps to include/exclude groups using the testng XML:

  1. Open Eclipse and create a new Java file with the name ExcludeGroup under the test.groups package in the previously created project.
  2. Replace the existing code in the file with the following code:
    package test.groups; import org.testng.annotations.Test; public class ExcludeGroup { @Test(groups={"include-group"}) public void testMethodOne(){ System.out.println("Test method one belonging to group."); } @Test(groups={"include-group"}) public void testMethodTwo(){ System.out.println("Test method two belonging to a group."); } @Test(groups={"include-group","exclude-group"}) public void testMethodThree(){ System.out.println("Test ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required