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 – test suite to include a particular package

Perform the following steps to create a test suite and include a particular package:

  1. Let's take the sample project created earlier for our tests.
  2. Create a testng XML file with name include-package-testng.xml in the project. Add the following code to it:
    <suite name="Include Package Suite" verbose="1">
      <test name="Include Package Test">
        <packages>
          <package name="test.*">
            <include name="test.secondpackage" />
          </package>
        </packages>
      </test>
    </suite>

    The preceding test suite defines a test, which includes all subpackages of the test package (defined by using regular expression test.*) and includes only a particular package from all the packages for test execution. This is done by using the ...

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