How to disable a test case in TestNG?

holothuroid
holothuroid

Posted On: Apr 06, 2020

 

To disable a test in TestNG, you can set the enabled attribute in the @Test annotation to false. It will disable the test method from execution from the test suite. To disable all the public methods inside the class, you can set this attribute at the class level.

//set the following attribute to false to disable test case in TestNG.
@Test(enabled=false)

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    TestNG Interview Questions

    What is TestNG?

    TestNG is a testing framework written in Java to cover a wide array of test categories like unit testing, functional testing, end-to-end test, integration test, etc. It is inspired from JUnit and NUni...

    TestNG Interview Questions

    List some features of TestNG Framework?

    Some of the important features of TestNG framework are,Support for Annotation. Support for data-driven-testing and parameters. Support for multiple instances in the same test class. Has a good ...

    TestNG Interview Questions

    What is Testng full form?

    The full form of TestNG is Test Next Generation....