0

I have a .NET MAUI application (targeting .NET 9) that runs on Windows. In the same repository, I also have a separate Appium-based UI automation project (using .NET 8), which drives the MAUI app externally for end-to-end UI testing.

Here's my setup summary:

  • MAUI app: built with .NET 9 (Windows target)
  • Automation tests: written in Nunit C# with Appium (.NET 8)
  • Test execution: the Appium tests launch and interact with the MAUI .exe (Windows app)

Goal: measure how much of the MAUI application's internal code is actually executed when the Appium UI automation tests run — i.e., application code coverage from UI tests (similar to what you'd get from unit test coverage, but for UI-driven execution).

What I'm not looking for:

  • Not the code coverage of my Appium test project itself.
  • Not feature/tag coverage (like screen-level mapping).

I specifically want to know which parts of the MAUI app code are executed when the UI tests run externally through Appium.

What I've tried:

  • I can successfully attach Appium Inspector to the MAUI app and run the tests — the automation works fine.
  • I tried running dotnet coverage collect while the MAUI app is open, but since Appium launches and closes the app multiple times per test (AS per our app requirement), the collector stops after the first instance.
  • I'm aware that coverage tools (like Coverlet or dotnet-coverage) typically instrument code running within the same process, but in my case, the tests are external.

Basically, I want to answer:

"When all my Appium UI automation tests run, what percentage of the MAUI app’s codebase is actually exercised?"

Environment details:

  • OS: Windows 11
  • MAUI version: .NET 9
  • Appium version: 2.17.1
  • Appium driver: Windows (WinAppDriver protocol)

Questions

Is it technically possible to collect application code coverage for a .NET MAUI app when tests are executed externally via Appium?

If yes, how can I configure the coverage collector to handle multiple app launches (since Appium opens and closes the app per test)?

Is there any known pattern or best practice in the .NET or Appium community for measuring this kind of UI-driven application coverage?

Notes

I'm aware of the difference between:

  • Unit test coverage — measuring internal code execution during in-process testing, and
  • UI automation coverage — measuring code execution indirectly through user-level automation.

I'm looking specifically for the second type, with a focus on actual code-level coverage, not test-case mapping. Because we don't have the manual test cases for all modules.

0

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.