WebViewDriver.Selenium 0.3.0

dotnet add package WebViewDriver.Selenium --version 0.3.0
                    
NuGet\Install-Package WebViewDriver.Selenium -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WebViewDriver.Selenium" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WebViewDriver.Selenium" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="WebViewDriver.Selenium" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WebViewDriver.Selenium --version 0.3.0
                    
#r "nuget: WebViewDriver.Selenium, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WebViewDriver.Selenium@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WebViewDriver.Selenium&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=WebViewDriver.Selenium&version=0.3.0
                    
Install as a Cake Tool

WebViewDriver.Selenium

This is the test-side package for WebViewDriver. It provides a Selenium RemoteWebDriver for a webview exposed by WebViewDriver.Host.

Install WebViewDriver.Host in the app under test before using this package.

Connect

Start the app with a port and random token:

var port = GetFreePort();
var token = Guid.NewGuid().ToString("N");

using var app = Process.Start(new ProcessStartInfo(appPath)
{
    Environment =
    {
        ["WEBVIEWDRIVER_PORT"] = port.ToString(),
        ["WEBVIEWDRIVER_TOKEN"] = token,
    },
});

Connect to the named webview:

using OpenQA.Selenium;
using OpenQA.Selenium.Support.UI;
using WebViewDriver.Selenium;

using IWebDriver driver = WebViewDriverClient.Connect(
    port,
    token,
    target: "main",
    timeout: TimeSpan.FromSeconds(30));

driver.FindElement(By.CssSelector("[data-test-id='save']")).Click();

new WebDriverWait(driver, TimeSpan.FromSeconds(10))
    .Until(d => (bool)((IJavaScriptExecutor)d)
        .ExecuteScript("return window.appReady"));

The returned object is a standard Selenium RemoteWebDriver, so existing locators, waits, page objects, SelectElement, script execution, and Actions can use it directly.

Readiness

Tests can wait for a DOM condition while connecting:

var options = new WebViewDriverClientOptions
{
    Timeout = TimeSpan.FromSeconds(30),
    ReadinessScript = "return window.appReady === true",
};

using var driver = WebViewDriverClient.Connect(
    port,
    token,
    "main",
    options);

Use WebViewDriverClient.ListTargets(port, token) to list webviews currently attached by the app.

Actions

The default Actions backend dispatches DOM pointer, keyboard, and wheel events. Use WebViewDriver.Selenium.AppiumMac when a test requires trusted operating system input.

Requirements and limitations

  • Targets .NET 10.
  • Supports Selenium.WebDriver 4.30.0 and later.
  • Frames must be same-origin.
  • Only one session should control a given webview at a time.
  • Cookies, alerts, BiDi, CDP emulation, and network interception are not implemented.

See the project documentation for the full command list and security notes.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on WebViewDriver.Selenium:

Package Downloads
WebViewDriver.Selenium.AppiumMac

Trusted-input Actions backend for WebViewDriver: routes W3C Actions through an Appium mac2 session as real OS input (CSS :hover, HTML5 drag-and-drop, canvas drags) at screen coordinates computed from the webview's accessibility frame. Optional companion to WebViewDriver.Selenium.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0 92 9/18/2026

Initial 0.3 release.