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 – using regular expressions in the testng XML

Perform the following steps to use regular expressions in the testng XML:

  1. Open Eclipse and create a new Java file with the name RegularExpressionGroup 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 RegularExpressionGroup { @Test(groups={"include-test-one"}) public void testMethodOne(){ System.out.println("Test method one"); } @Test(groups={"include-test-two"}) public void testMethodTwo(){ System.out.println("Test method two"); } @Test(groups={"test-one-exclude"}) public void testMethodThree(){ System.out.println("Test method three"); } @Test(groups={"test-two-exclude"}) ...

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