2

I am automating test cases in python and results are redirected to text file by default for unittest. I want result to be generated in XML format so that I can easily track passed and failed test cases. Please suggest.

1 Answer 1

1

There is a seperate package called unittest-xml-reporting

To use it add this to your unit test

import xmlrunner

Then pass the XMLRunner to unittest like this:

if __name__ == '__main__':
    unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports'))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.