There may be some scenarios where you may have to disable a particular test or a set of tests from getting executed. For example, consider a scenario where a serious bug exists in a feature due to certain tests belonging to certain scenarios that cannot be executed. As the issue has already been identified we may need to disable the said test scenarios from being executed.
Disabling a test can be achieved in TestNG by setting the
enable attribute of the
Test annotation to
false. This will disable the said test method from being executed as part of the test suite. If this attribute is set for the
Test annotation at class level, all the public methods inside the class will be disabled.
Lets go ahead and create a sample project to ...