Testing with the Visual Runner
The visual test runner provides an interactive UI for running tests directly on-device. It is the simplest way to run tests during development — just run the test app like any other app, either via the CLI or in the IDE.
How It Works
The visual runner is integrated into a .NET MAUI app using the UseVisualTestRunner() extension method. When the app launches, it displays a test explorer UI that lets you:
- Browse all discovered tests grouped by assembly and class
- Run all tests or select individual tests to run
- View test results with pass/fail status and error details
- Filter tests by name or status
Screenshots
Setup
Add the visual runner to your MAUI test app's MauiProgram.cs:
var builder = MauiApp.CreateBuilder();
builder
.ConfigureUITesting()
.UseVisualTestRunner(conf => conf
.EnableAutoStart(true)
.AddTestAssembly(typeof(MyTests).Assembly)
.AddXunit()
.AddNUnit()
.AddConsoleResultChannel()
.AddTcpResultChannel(new TcpResultChannelOptions
{
HostNames = ["localhost"],
Port = 16384
}));
See Also
- Technical Architecture Overview - Full details on the visual runner architecture
- Types of Tests - Understanding different testing approaches
- Using DeviceRunners CLI - Running tests from the command line