junitparser icon indicating copy to clipboard operation
junitparser copied to clipboard

Parsing XML with <failure message="Test failure"> node

Open ChrisVanBael opened this issue 1 year ago • 1 comments

Hi,

Probably not really a defect in junitparser, maybe more of a question.

We are using Tricentis Tosca and this returns an xml similar to the one below: <?xml version="1.0" encoding="utf-8"?> <testsuites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <testsuite name="SCM | MRP-Run" tests="1" failures="1" skipped="0" time="53.1835262" timestamp="2024-07-25T13:22:04" id="3a133ca4-f190-8e4c-3490-fd880b1108df" log=""> <testcase name="MRP-run" time="50.8851679" timestamp="2024-07-25T13:22:04.1771427+02:00" log="- Failed MRP-run detailed info on the failures"> <failure message="Test failure">-detailed info on the failure </failure> </testcase> </testsuite> </testsuites>

junitparser doesn't seem to handle the element well. I can't find any testcase info when a failure has happened. Can I change how junitparser parses this xml? I am asking Tricentis what is the XSD and/or library they have used to generate this xml. Most XUnit libraries seem to have message has a sub element of failure, not as

Thanks for your help!

ChrisVanBael avatar Jul 26 '24 06:07 ChrisVanBael

Hi Chris, can you provide your code samples to me cuz I tried the example above and it seems to work. image

weiwei avatar Sep 01 '24 03:09 weiwei