What is Soft and Hard Assert in TestNG?

Atul Kumar Kushwaha
Atul Kumar Kushwaha

Posted On: Apr 05, 2020

 

The Soft assert collects error during the testing process in TestNG. When an assert fails, the soft assert doesn’t throw an exception and continues to do the next step with the assert statement.

Hard assert, by contrast, throws an AssertExceptionimmediately if an assert statement fails, then the test suite continues with the next @Test.

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