Export Azure DevOps test cases and results to PDF
Michael Thomsen
· Updated ·5 min read
Short answer: For test case definitions, export CSV or XLSX from Azure Test Plans, or use a template to render steps and expected results into a readable PDF. For execution evidence, identify the plan, suite, configuration and run you need first. A case checklist and a suite outcome summary are not a history of test executions.
This guide compares the export routes and provides separate starter blocks. For the product setup, subscription requirements and reusable workflow, see Bravo Notes test reports.
Choose what the PDF must prove
| Document | Source and scope | What it does not prove |
|---|---|---|
| Test case checklist | Selected Test Case work items, steps and expected results | Whether those steps passed in a run |
| Suite outcome summary | Test points for a specified plan, suite and optional configuration | Every historical execution or the result of one pipeline run |
| Requirements coverage | Selected requirements and their Tested By links | That linked tests ran or passed |
| Run evidence | Explicit run IDs, results, timestamps and execution attachments | The definition of every case in the backlog |
A work item's State is its lifecycle state, not a passed or failed execution outcome. A test case can also have several test points because it is used in different configurations. Do not compare suite totals with a count of unique work item IDs as though they were the same measure.
Option 1: Use the built-in export
For a spreadsheet of test case definitions, use the Test Plans bulk CSV or XLSX export. This is useful for moving or reviewing case data; it is not a formatted execution-evidence PDF.
For a plan report, use the plan or suite Export dialog and its print view. Microsoft's Test Plans FAQ documents a maximum of 75 suites per export, a 1 MB limit for the email, and no test plan attachments. The FAQ also describes copying the print view into Word while retaining report formatting. Do not treat that email limit as a universal PDF file-size limit.
Check the resulting report against the requested evidence before distributing it. If the requester needs run timestamps, execution attachments or historical results, a plan print view alone may not satisfy the request.
Option 2: Collect explicit run evidence with the API
For a specific execution, start with the Test Runs API and Test Results API. A reporting script needs to select the intended run IDs, retrieve results and attachments with an authorized identity, and render the document.
Retain the run ID, configuration, outcome and execution time alongside each result. Decide how reruns and failed attempts should be shown. Fetching the current suite summary after a pipeline finishes does not automatically isolate that pipeline's results.
Option 3: Use a reusable Bravo Notes template
Bravo Notes renders selected work items into PDF, HTML or Markdown. Its Test Plans integration requires Business or above. The starter below prints definitions; the separate summary block adds suite test-point counts. Neither block is a complete run-history report.
Starter: test case definitions with steps
Add Test Case work items using a saved query, then paste this on the Template tab. Create ProductName and Version parameters. The date is the generation date, not the date the tests ran.
# Test checklist: {{ param 'ProductName' }} {{ param 'Version' }}
Prepared {{ date format='d mmmm yyyy' }}.
{{#workItems orderBy='Id'}}
## {{ id }}: {{ field 'Title' }}
**Work item state:** {{ field 'State' }}
<table>
<thead>
<tr><th>#</th><th>Step</th><th>Expected result</th></tr>
</thead>
<tbody>
{{#testSteps}}
<tr><td>{{ no }}</td><td>{{{ step }}}</td><td>{{{ expectedResult }}}</td></tr>
{{/testSteps}}
</tbody>
</table>
{{/workItems}}
The syntax reference documents the testSteps block. Step attachments and execution results require additional template sections. A link to an attachment is not the same as embedding its contents in a portable PDF; check the exported file as the intended reader.
Add a suite outcome summary
Replace these example plan and suite IDs with the IDs from your own Test Plans URL:
{{#testCaseSummary testPlanId=112 testSuiteId=118}}
| Total | Passed | Failed | Blocked | Not run |
|-------|--------|--------|---------|---------|
| {{ totalTests }} | {{ passedTests }} | {{ failedTests }} | {{ blockedTests }} | {{ notExecutedTests }} |
{{/testCaseSummary}}
The query and suite are separate inputs. Loading cases from an area-path query does not constrain the summary to those same cases. Check suite membership and configurations before interpreting the counts. Use configurationName only when you intend to filter to a named test configuration; a configuration name is not a deployment environment filter or a regulatory validation claim.
For per-case or per-step execution outcomes, ask support for the test-report sample and confirm which results it selects. Do not label the starter's suite counts as a full execution history.
Add requirements coverage separately
Load the requirements and follow their Tested By links using linkSection. Its fallback branch can flag selected requirements without a linked test case. The requirements document workflow includes that starter. A missing link is a traceability gap; an existing link is not evidence of a passed test.
Validate the report before sharing it
- Record the product/version, query, plan, suite, configuration and generation date. Add explicit run IDs when reporting executions.
- Compare one known passing and one known failing test point with Azure Test Plans. Check whether multiple configurations explain a higher total than the case count.
- Verify steps and expected results for a selected case. Keep lifecycle state and execution outcome distinctly labelled.
- Check images and attachment access outside your signed-in session, using only data approved for that audience.
- Export the PDF and retain that file if you need a record. Regenerating later reads current data, not necessarily the same evidence.
For layout settings, see PDF cover pages, table of contents, headers and footers. The build task can regenerate a saved template in a pipeline; set the report's data scope explicitly rather than assuming that task placement selects a run.
Frequently asked questions
Can I export Azure DevOps test cases to PDF without an extension? Use the plan or suite Export print view and your browser's PDF printing where available. For case data, the CSV or XLSX export is another starting point. Check that the output includes the evidence your reader requested.
Does the starter show whether each test case passed? No. It prints definitions, steps and expected results. The separate summary block reports suite test-point counts. Per-case execution results need an additional, scoped result template.
Why does the suite total exceed the number of test cases? A case can contribute multiple test points across configurations. The query and suite can also select different scopes. Compare membership and configuration before treating a mismatch as an export error.
Can this produce a certified audit report? The template formats the selected data. Your team must decide which evidence, approvals and retention satisfy its review or audit requirements; exporting a PDF does not certify compliance.
Summarize this article