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 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 ...