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

Adding classes, packages, and methods to test

Earlier we learned about creating test suites, suites with multiple tests, and running them through TestNG. Now we will learn how to create and configure suites to execute only the tests belonging to a particular class or a package or just a particular test method.

In earlier examples you may have noticed tests with a single class. In this section we will learn how to add multiple classes to a test.

Sample project

Before going ahead with creation of test suite with classes, packages, and test methods, we will need a sample project in place for defining test suites for test execution. Let's create a sample project first:

  1. Open Eclipse and create a new project with three packages, each package containing ...

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