Advertisement

Assertion: What is TestNG Assertion in Automation?How it works?

Assertion: What is TestNG Assertion in Automation?How it works? TestNG Asserts help us to verify the condition of the test in the middle of the test run. Based on the TestNG Assertions, we will consider a successful test only if it is completed the test run without throwing any exception.
There are two types of Assert in TestNG:
1)Hard Assert
2)Soft Assert

Hard Assert – Hard Assert throws an AssertException immediately when an assert statement fails and test suite continues with next @Test

Soft Assert – Soft Assert collects errors during @Test. Soft Assert does not throw an exception when an assert fails and would continue with the next step after the assert statement.

More in details:

TestNG Assertion,Assertion,

Post a Comment

0 Comments