Skip to content
Novus Examples
xml681 B

JUnit XML — Skip with Message and Body

A skipped case whose reason appears twice — in the message attribute and again as CDATA text inside the <skipped> element. Reporters that read only the attribute silently drop the longer explanation.

Preview — first 11 linesxml
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="cart.DiscountTest" tests="3" failures="0" errors="0" skipped="1" time="0.112" timestamp="2026-08-07T09:14:22" hostname="ci-runner-04">
    <testcase classname="cart.DiscountTest" name="appliesPercentageDiscount" time="0.064"/>
    <testcase classname="cart.DiscountTest" name="appliesLoyaltyTier" time="0.000">
      <skipped message="loyalty tiers are disabled in the CI profile"><![CDATA[Loyalty tier lookups need the partner API, which the CI profile stubs out.]]></skipped>
    </testcase>
    <testcase classname="cart.DiscountTest" name="ignoresExpiredCoupon" time="0.048"/>
  </testsuite>
</testsuites>

Specifications

Seed
61200
Dialect
surefire
Encoding
UTF-8
Line Endings
LF
Tests
3
Failures
0
Errors
0
Skipped
1
Passed
2

Testing contract

Expected to pass
Scenario
Surface the reason a test was skipped, not just the fact that it was.
Expected result
The skip reason is read from both the message attribute and the element body, and the longer CDATA explanation is preserved.

What is a .xml file?

XML (Extensible Markup Language) is a verbose, self-describing markup language using nested tags, attributes, and namespaces to represent structured, hierarchical data. It supports schemas, entities, and validation and underlies many document and data formats. It remains common in enterprise, publishing, and interchange contexts.

How to use this file

Use an example XML file to test parsers, namespace and schema validation, XPath queries, and protection against entity-expansion and external-entity attacks.

How to use this file for testing

“JUnit XML — Skip with Message and Body” is a deterministic Novus Examples fixture for Error handling, Conversion testing, Log parsing. Deliberately corrupt and invalid files, clearly labelled, for testing how your tool fails.

Documented properties for this file: seed 61200 · UTF-8 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Test and coverage reports document their totals (suites, cases, passes, failures, skips, covered lines) in the spec table. Point your CI dashboard, coverage gate, or report converter at the file and assert those counts survive; format twins carry identical numbers so a conversion can be scored exactly.

Code examples

import xml.etree.ElementTree as ET

tree = ET.parse("outcome-skipped-with-message.xml")
root = tree.getroot()
print(root.tag, [c.tag for c in root][:5])

Generated by generation/testing.py. Free for any use, no attribution required — license.