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

Chapter 4. Groups

In the previous chapter we learned about different annotations provided by TestNG and how to use them. In this chapter we will cover the grouping of test methods, which is one of the most important concepts of TestNG.

In this chapter we'll cover the following topics:

  • Grouping tests
  • Running tests in a group
  • Tests belonging to multiple groups
  • Including/excluding groups
  • Using regular expressions
  • Default group
  • Group of groups

Grouping tests

As we have mentioned previously, grouping test methods is one of the most important features of TestNG. In TestNG users can group multiple test methods into a named group. You can also execute a particular set of test methods belonging to a group or multiple groups. This feature allows the test methods ...

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