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 – creating a test with packages

Perform the following steps to create a test with packages:

  1. Let's use the same sample project created earlier.
  2. Add new file TestNG configuration XML by name package-testng.xml to the project with following content:
    <suite name="Package Suite" verbose="1">
      <test name="Package Test">
        <packages>
          <package name="test.firstpackage" />
          <package name="test.secondpackage" />    
        </packages>
      </test>
    </suite>

    The preceding testng XML suite defines a test with two packages (test.firstpackage and test.secondpackage, respectively) as you can see. To add a package to your test suite just use a combination of the packages and package tag as shown in the previous code. Use the package tag with the attribute name having a ...

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