3

In my Test Automation, when we execute the TestNg Suite XML then whenever any test case fails the Jenkins Build also fails.

But I require that the TestNG report shows the proper result, either Pass or Fail, and at same time the jenkins build should show success because all test case executed.

I understand that TestNG throws either a hard or soft Assertion on any test case failure. And I guess due to that exception the whole jenkins build also fails.

closed as unclear what you're asking by Michael Durrant, Kate Paulk, IAmMilinPatel, dzieciou, Niels van Reijmersdal Mar 18 '16 at 8:29

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • It's hard to understand exactly what the question is – Michael Durrant Mar 11 '16 at 11:47
  • I think the question boils down to this: How do I prevent failures in a TestNG suite from failing my entire Jenkins job?. @user3591670 Exactly how do you run the TestNG suite? Do you use the "Invoke Ant" build step, or something else? If the latter, please be specific. – user246 Mar 11 '16 at 13:23
  • Could you try re-wording your question? include what you want to happen and what is stopping that from happening. – ECiurleo Mar 11 '16 at 14:25
  • 1
    A tad cheeky remark: You may want to rethink your test-cases. There is a reason it works like this: Failed test cases means the build does not work and is broken. Perhaps you need a different way to determine all your test cases are doing their proper job? – Bookeater Mar 12 '16 at 8:32
  • Requirement is bit tricky for me. Because when I drill down and found that I need to resolve my problem from TestNG prespective instead of Jenkins. Thanks for feedback as I am working towards solving it at my automation framework level. – saurabhguptacse May 2 '16 at 3:27
1

I am new so i cannot comment, to get more details

If this is maven build, try adding  

-Dmaven.test.failure.ignore=true

into MAVEN_OPTS, advance button in build section of jenkins

Not the answer you're looking for? Browse other questions tagged or ask your own question.