View Full Version : In TestNG how can you disable a test?
warrantyau
12-18-2019, 02:13 AM
In TestNG how can you disable a test?
Saravanan28
02-11-2020, 08:34 AM
Disabling a test in TestNG can be achieved 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.
dennis123
02-11-2020, 10:30 PM
Hi Friends,
When executing TestNG tests, 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 in TestNG can be achieved 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.
@Test( enabled=false )
Powered by vBulletin® Version 4.2.4 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.