TestNG Assertions | Soft assertion and Hard assertion in Selenium TestNG

preview_player
Показать описание
Hard #assertion are used when you want to halt the execution of the test script (or test method) when the assert condition does not match with the expected result. #softassertion are used when the test script (or test method) need not be halted when the assertion condition does not meet the expected result. #testng #softassertion #hardassertion
Here is the sample TestNG class for your reference-

public class SoftAndHardAssertions {
@Test(priority=1)
public void softAssertion() {
SoftAssert softassert = new SoftAssert();
}
@Test(priority=2)
public void hardAssertion() {
}
}

Following points are covered in this video-
What are the different Assertions in TestNG?
How to Use Soft Asserts in TestNG
How to Use Hard Asserts in TestNG
Difference between Soft and hard assert in TestNG.

Keep learning and thanks for watching 👍🙏
Рекомендации по теме
Комментарии
Автор

It is very straight forward and very clear. Thanks @sdetadda

talentvista