Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SoftAssert printing same assertion message for all failed test methods #976

Closed
shivakrishnach31 opened this issue Feb 4, 2016 · 3 comments

Comments

@shivakrishnach31
Copy link

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.

@juherr
Copy link
Member

juherr commented Feb 4, 2016

Hello,

I think stackoverflow or the mailing list is a better start.

BTW,

  • Which TestNG version are you using? Did you try to upgrade it?
  • Could you share a test sample?
  • What is your current output? What is the expected one?

@rouke-broersma
Copy link

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

@shivakrishnach31
Copy link
Author

@Mobrockers , It worked now. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants