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

Include and exclude

Include and exclude is one of the most important features of TestNG, which allows tests to be configured to include or exclude certain classes, packages, methods, and groups. We covered this topic in earlier chapters when we were talking about the testng XML configuration. In this section we will cover few similar things, but this time instead ofusing a testng XML configuration file, we will define the configuration through code. We will cover a few examples to include and exclude methods and groups in a test.

Include/exclude methods

Include/exclude methods allow certain methods from a class to be included or excluded from a test run. Let's write a sample program to learn how to configure a test through code to include certain ...

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