Wednesday, 11 January 2017

Soft assertions vs Hard assertions in TestNG

When hard assertion will fail Inside any test method, remaining execution of that specific test method will be aborted. Now If you wants to continue remaining test part execution even If assertion fails and also you wants to report assertion failure In testng result report then you can use testng soft assertion method.

syntax:

import org.testng.asserts.SoftAssert;
SoftAssert s_assert = new SoftAssert();
s_assert.assertEquals(actual, expected);

No comments:

Post a Comment