Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Use NUnit and your .NET test runner to produce the evidence report; Selenium WebDriver only drives the browser. A practical starting point is NUnit-format XML generated with dotnet test --logger:nunit, then archived or rendered by your CI/reporting system. The XML can preserve test statuses, failure details, timing, environment data, output, and attachment paths, while screenshots must be captured and attached through the runner or adapter you use.

What Selenium, NUnit and the report each do

Selenium WebDriver performs browser actions and assertions are evaluated by your test code and NUnit. Selenium’s documentation explicitly says that “Selenium is not designed to report on the status of test cases run.” The test framework and runner own that responsibility. NUnit’s result format is therefore the durable evidence artifact; an HTML dashboard or CI page is a presentation layer built from it.

  • Selenium WebDriver: opens pages, locates elements, clicks, types and reads browser state.
  • NUnit: defines tests, assertions, setup/teardown and statuses such as passed, failed, skipped and inconclusive.
  • Runner and logger: execute the assembly and serialize results, diagnostics and optional attachments.
  • CI or reporting integration: archives XML and may render a browser-readable report. Selenium’s reporting guidance mentions framework-produced xUnit or HTML output and integrations such as Allure; verify compatibility with your runner and NUnit version before enabling one.

Prerequisites and runner choice

You need a C#/.NET test project that references NUnit, an NUnit adapter compatible with your test platform, Selenium WebDriver packages and a browser/driver setup suitable for your environment. Microsoft’s NUnit guide uses dotnet new nunit to create a project, while Selenium’s .NET setup documentation uses dotnet test to run it. Confirm whether the project runs on the Visual Studio Test Platform (VSTest) or Microsoft.Testing.Platform (MTP): logger switches differ.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Create or open the test project, for example with dotnet new nunit -n UiEvidence.Tests.
  2. Add Selenium WebDriver and the browser-specific driver package required by your project, then restore with dotnet restore.
  3. Run the unfiltered suite once with dotnet test and fix discovery or browser-startup errors before adding reporting.
  4. Record the SDK, target framework, NUnit adapter, test platform and logger package versions in your build configuration. Logger options are version-sensitive.

Generate NUnit XML with VSTest

The documented VSTest route uses the NUnitXml.TestLogger package. Add it to the test project (use the current package version shown on NuGet), then run:

dotnet add UiEvidence.Tests package NUnitXml.TestLogger
dotnet test --logger:nunit

By default, the package writes the result beneath a TestResults directory relative to the test project. To choose a deterministic file name or location, pass the logger argument in quotes:

dotnet test --logger:"nunit;LogFilePath=test-result.xml"

Quoting matters in shells where a semicolon separates commands. Use a path that your CI job can collect, such as a workspace-level artifacts/test-result.xml, and create the directory before the run if your logger version requires it.

Microsoft.Testing.Platform projects

The logger package documents a separate MTP option, --report-spekt-nunit, followed by a filename argument. Do not substitute this switch blindly: first identify the platform used by the project and check the package’s current command syntax. A command accepted by VSTest is not evidence that the same command is valid under MTP.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the NUnit XML contains

NUnit’s result XML is machine-readable and can be retained as the canonical run record. Depending on the adapter and logger, it can include:

Evidence Typical value Why it matters
Run status and totals Result plus total, passed, failed, inconclusive and skipped counts Shows the outcome without opening every case
Identity Test and suite names, fixtures and case information Connects evidence to the code under test
Failure diagnostics Assertion/error message and stack trace Preserves the reason and location of a failure
Timing UTC start/end times and duration Establishes when and how long the run took
Environment Framework/runtime, operating system, platform, working directory, machine, user/domain, culture and architecture Makes environment-specific failures diagnosable
Output Captured test output Provides logs or diagnostic text emitted by the test
Attachments Fully rooted file path and optional description Links screenshots, videos or logs to a result
Execution context Command-line and filter information where populated Explains which subset actually ran

These are capabilities of the format, not a guarantee that every adapter populates every optional field. Filtering is especially important: totals describe the executed selection, not necessarily every test in the assembly.

Capture screenshots and attach them safely

A report does not take screenshots by itself. Your test or runner must capture the image, associate it with the failing (or selected) case using the attachment mechanism supported by that adapter, and publish both the XML and the file. Because attachment APIs vary between NUnit adapters and test platforms, use the API documented for your exact versions rather than copying a runner-independent snippet.

A robust evidence sequence

  1. In teardown or an equivalent failure hook, determine whether the test failed and build a unique file name containing the test name, timestamp or test-case identifier.
  2. Save the screenshot to a known workspace directory. Prefer an absolute path while the test is running.
  3. Register the file through your adapter/runner’s documented attachment facility, with a description such as “Browser state at failure.”
  4. Configure CI to collect that directory and the NUnit XML as artifacts. Preserve the same relative layout referenced by the XML, or rewrite paths in a supported post-processing step.
  5. Open the collected XML and verify that the attachment path resolves in the downloaded artifact bundle.

Do not assume an attachment element embeds binary data; NUnit XML normally records a file path. A successful local run can still produce a broken CI report if the image is outside the published artifact directory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make the report readable in CI

Keep the NUnit XML even if your CI system displays a summary. XML is portable and can be reprocessed later; a web dashboard is usually tied to one provider. Configure the pipeline to:

  • run the same command and filters used for the intended evidence;
  • publish test-result.xml regardless of pass/fail, so failed runs remain inspectable;
  • publish the screenshot/log directory with the XML;
  • retain the SDK, browser, driver, operating-system and test-platform versions in job metadata;
  • fail the job according to your policy after artifacts have been collected.

A renderer can turn NUnit XML into HTML, trend data or a CI-native test view. Check that it understands your NUnit schema, preserves stack traces and displays attachments. Selenium’s guidance points to framework and reporting integrations rather than a Selenium-generated HTML format.

Validation checklist after every run

  • The result file exists at the expected path and is valid XML.
  • The top-level result and status counts match the tests and filters you intended to execute.
  • A deliberately failing test retains its assertion message and stack trace.
  • Start/end timestamps and duration are present and use the expected time basis.
  • Environment fields identify the runtime and operating system sufficiently to reproduce the run.
  • Captured output contains useful diagnostics, not secrets or access tokens.
  • Every attachment path resolves both locally and after CI artifact download.
  • The report identifies the commit, build, browser and test command through CI metadata or test output.

Troubleshooting common failures

No tests discovered

Usually the project lacks a compatible NUnit adapter, targets an unsupported framework, or is being run from the wrong directory. Run dotnet test -v:n, inspect discovered tests, verify package compatibility and build the test project before rerunning the logger.

Rank #3
Sale

Unknown logger or invalid logger argument

Ensure NUnitXml.TestLogger is referenced by the test project, not only installed globally. Check whether you are using VSTest or MTP and use that platform’s documented switch. Quote arguments containing semicolons.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The XML is created but has no useful cases

Confirm that the same configuration, target framework and filter were used for build and test. A filter can legitimately produce a small result. Inspect the XML’s command/filter information and rerun without a filter to separate filtering from discovery problems.

Screenshots are missing in CI

Check that the browser process could write to the target directory, that teardown still runs after a failure, and that CI publishes the image directory. An XML attachment path pointing to a developer workstation will not resolve on an artifact viewer.

Browser failures obscure the test result

Capture the exception, browser/driver versions and a screenshot at the failure boundary. Distinguish a Selenium session startup error from an assertion failure so the report’s message remains actionable.

HTML rendering loses details

Inspect the original NUnit XML first. If stack traces or attachments are present there, the renderer is the limiting component; choose a version that supports your NUnit schema or provide the XML as the authoritative download.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Performance, reliability and cost considerations

Writing one XML file per run is inexpensive, but browser screenshots and videos can consume significant artifact storage. Capture screenshots on failure by default, use deterministic compression and retention policies, and avoid embedding sensitive page data. Parallel tests need unique file names and isolated browser/session directories. Network-dependent pages can fail intermittently; record the URL, wait strategy and browser console information when available, and keep retries explicit so the report does not hide a flaky test.

For reproducibility, pin package and SDK versions in the repository, run the same platform locally and in CI, and store the exact test command and filter with the build. Treat logger output as an artifact of a particular toolchain: upgrading the adapter or test platform may change optional fields or command syntax.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

When the evidence you need is a screenshot of a URL rather than an interactive Selenium assertion, ScreenshotNeo provides a single HTTP call. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each step can be disabled. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing status. It also offers an MCP server with take_screenshot, get_page_info and capture_pdf for Claude, Cursor and other MCP clients.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

See the ScreenshotNeo documentation for parameters and response handling. Every plan includes its features: full-page and element captures, device presets and custom viewports, retina scale, dark mode, PDF options, custom CSS/JavaScript, clicks, waits, blocking rules, headers/cookies/user agents, timezone and geolocation, transparent backgrounds, resizing, chosen-TTL caching, signed links, asynchronous webhooks, bulk capture of up to 100 URLs per call, usage data and an OpenAPI specification. The parameter names used by other screenshot APIs also work for easier migration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Plan Allowance and price
Free 1,000 shots/month, no card
Starter $5 for 3,000 shots
Growth $15 for 15,000 shots
Pro $39 for 60,000 shots
Scale $99 for 250,000 shots
Business $249 for 1,000,000 shots

Yearly billing gives two months free. You can sign up free for 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.

FAQ

Does NUnit XML automatically include a screenshot?

No. The format supports attachment paths, but your test or runner must create the file and register it through the mechanism supported by your adapter.

Should I treat HTML as the primary report?

Keep NUnit XML as the durable source and use HTML or a CI view for reading and sharing. This preserves details if a renderer changes or becomes unavailable.

Can I use the same logger command on every .NET test platform?

No. The documented VSTest logger command and the MTP reporting switch are different. Identify the platform and verify current package syntax before running in CI.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Does NUnit XML automatically include a screenshot?

No. The format supports attachment paths, but your test or runner must create the file and register it through the mechanism supported by your adapter.

Should I treat HTML as the primary report?

Keep NUnit XML as the durable source and use HTML or a CI view for reading and sharing.

Can I use the same logger command on every .NET test platform?

No. VSTest and Microsoft.Testing.Platform use different documented options.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.