NUnit3 Console runner saves test results in xml at the end of the test run. But in my case I want to save the partial results on each test failure, so that in case console runner crashes or is stopped, I can still get partial results for completed tests.

Is there a way to do that?

1 Answer 1


You could use NUnit3's TestContext that creates a TextWriter and save the output where ever you want.

I use Console.WriteLine() and read the Output in Visual Studio's Test Explorer (requires you have the NUnit3TestAdapter). This also works when I run tests via Bamboo. Anything written to the Console is saved in the Bamboo log.

  • my aim here is to convert the xml to an html report and use it in our in-house application to display result. But I don't want to wait for the test run to finish before I can access it, specially on test failures.
    – H.D.
    Commented Mar 2, 2017 at 23:02
  • With the TextWriter, you can write out to a file (txt, xml, html, etc.) and parse it whenever/however you want.
    – kirbycope
    Commented May 1, 2017 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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