Plugin.Maui.UITestHelpers.Repl
1.0.0
dotnet add package Plugin.Maui.UITestHelpers.Repl --version 1.0.0
NuGet\Install-Package Plugin.Maui.UITestHelpers.Repl -Version 1.0.0
<PackageReference Include="Plugin.Maui.UITestHelpers.Repl" Version="1.0.0" />
<PackageVersion Include="Plugin.Maui.UITestHelpers.Repl" Version="1.0.0" />
<PackageReference Include="Plugin.Maui.UITestHelpers.Repl" />
paket add Plugin.Maui.UITestHelpers.Repl --version 1.0.0
#r "nuget: Plugin.Maui.UITestHelpers.Repl, 1.0.0"
#:package Plugin.Maui.UITestHelpers.Repl@1.0.0
#addin nuget:?package=Plugin.Maui.UITestHelpers.Repl&version=1.0.0
#tool nuget:?package=Plugin.Maui.UITestHelpers.Repl&version=1.0.0

Plugin.Maui.UITestHelpers
Plugin.Maui.UITestHelpers provides a set of helpers to support UI testing your .NET MAUI app with Appium and migration from Xamarin.UITest to Appium. It consists of three packages, see below for more information.
The set of helpers are extracted from the .NET MAUI codebase (here, the folders prefixed UITest) this code can help with writing UI tests with Appium and/or transition your existing Xamarin.UITest tests to Appium.
At this time this project is not officially supported and experimental. Feel free to let us know your feedback and provide pull requests to make it even better. There is no guarantee this will become something more official.
<sub>But if you like what you see and help make it better... It might! </sub>
Install Plugin
This project consists of four packages. please find the details below. All packages are available on NuGet.
Install with the dotnet CLI, for example: dotnet add package Plugin.Maui.UITestHelpers.Appium, or through the NuGet Package Manager in Visual Studio.
Supported Platforms
All platforms that are supported by the cross section of the support of Appium and .NET MAUI.
On Android, app data is preserved by default when AppId is set. Set FullReset to true
and provide an AppPath to reinstall the app when the Appium session starts. Do not enable
NoReset and FullReset together.
FullReset applies when an Appium session starts, not before each test. UITestBase reuses one
session across tests and only starts a new one when Reset() is called, for example after a crash.
To start every test from a freshly launched app, add a [SetUp] method to your test class that
derives from UITestBase:
using NUnit.Framework;
using Plugin.Maui.UITestHelpers.Appium;
[SetUp]
public void RestartApp() => App.ResetApp();
ResetApp() closes and relaunches the app, but keeps its data. Leave the app running at the end
of a test: if the app is closed when the test finishes, UITestBase treats it as a crash and fails
the test.
REPL
Call App.Repl() from a test to pause it and open an interactive prompt that is connected to your running app. Anything you type is C#, with app being the app, so you can try app.Tap("CounterBtn") or look at the screen with tree, and copy what worked into your test. It works on every platform Appium does.
using Plugin.Maui.UITestHelpers.Core;
[Test, Explicit]
public void ExploreTheApp()
{
App.WaitForElement("CounterBtn");
App.Repl(); // continues when you type 'exit'
}
Install Plugin.Maui.UITestHelpers.Repl to use it. See the REPL guide for everything it can do.
While debugging, call App.Repl() from code (or step over that line) rather than from Visual Studio's Immediate Window, where the debugger freezes the threads the REPL needs. See While debugging.
Passing other Appium capabilities
To set an Appium capability that doesn't have its own config property, add it to the
AdditionalCapabilities dictionary in your test config:
config.SetProperty("AdditionalCapabilities", new Dictionary<string, object>
{
["systemPort"] = 8201,
["disableWindowAnimation"] = true,
});
Names without a vendor prefix get the appium: prefix. These capabilities are applied last, so
they also override values the library sets itself, such as newCommandTimeout. For capabilities
that have their own config property, such as AppId (appPackage/bundleId), use that property:
the library also relies on it after the session has started. Standard W3C capabilities (like
platformName), automationName (set by the library for each platform) and app, deviceName
and platformVersion (use AppPath, DeviceName and PlatformVersion) can't be set this way.
See the driver documentation for the available capabilities, for example the
UiAutomator2 capabilities.
Testing webview content
On Android and iOS you can interact with the content of a WebView (or a Blazor Hybrid
BlazorWebView) by switching to its webview context:
App.SwitchContextToWebview();
App.TapWebviewButtonByText("Sign in");
App.ScrollWebview(down: true);
App.SwitchContextToNative();
For Appium to find the webview, your app has to make it debuggable: on Android call
Android.Webkit.WebView.SetWebContentsDebuggingEnabled(true), on iOS 16.4 and later set
Inspectable = true on the WKWebView (see the sample's MauiProgram.cs). Only do this in
builds you test, not in production builds. On Android, Appium also needs a Chromedriver that
matches the WebView version on the device, for example by starting Appium with
--allow-insecure uiautomator2:chromedriver_autodownload.
Related resources
To make it easier to add UI test projects to your existing solution, I also have a template that you can use: https://github.com/jfversluis/Template.Maui.UITesting/
Additionally, please find some blog posts and samples that we have made available to get you started:
- https://devblogs.microsoft.com/dotnet/dotnet-maui-ui-testing-appium/
- https://devblogs.microsoft.com/dotnet/browserstack-appium-dotnet-maui/
- https://learn.microsoft.com/samples/dotnet/maui-samples/uitest-appium-nunit/
- https://learn.microsoft.com/samples/dotnet/maui-samples/uitest-browserstack/
Acknowledgements
This project could not have came to be without these projects and people, thank you! ❤️
The original source was extracted from the .NET MAUI codebase so all credit goes out to that team, namely @sbanni, @mattleibow, @PureWeen, @MartyIX, @jsuarezruiz, @jfversluis and @rmarinho.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Microsoft.CodeAnalysis.CSharp.Scripting (>= 5.12.0)
- Plugin.Maui.UITestHelpers.Appium (>= 1.0.0)
- Plugin.Maui.UITestHelpers.Core (>= 1.0.0)
- PrettyPrompt (>= 6.0.5)
- Spectre.Console (>= 0.57.2)
- TextCopy (>= 6.2.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 52 | 11/25/2026 |