In a Java class I have written around 10 @Test methods. In this class I have created a object(softAssert) for SoftAssert class. In each method at the end of the code I written softAssert.assertAll();
But this line of code printing the first failed assertion message for all the failed methods.
I want to print separate assertion message for each and every method. could any one help me to overcome this.
Hello,
I think stackoverflow or the mailing list is a better start.
BTW,
@shivakrishnach31 softAssert object does not clear the list of failed asserts when calling assertAll, so you cannot reuse the same softAssert object in multiple tests. Create a new object at the beginning of every test to fix your problem.
@Mobrockers , It worked now. Thank you.
Most helpful comment
@shivakrishnach31 softAssert object does not clear the list of failed asserts when calling assertAll, so you cannot reuse the same softAssert object in multiple tests. Create a new object at the beginning of every test to fix your problem.