WebViewDriver.Selenium
0.3.0
dotnet add package WebViewDriver.Selenium --version 0.3.0
NuGet\Install-Package WebViewDriver.Selenium -Version 0.3.0
<PackageReference Include="WebViewDriver.Selenium" Version="0.3.0" />
<PackageVersion Include="WebViewDriver.Selenium" Version="0.3.0" />
<PackageReference Include="WebViewDriver.Selenium" />
paket add WebViewDriver.Selenium --version 0.3.0
#r "nuget: WebViewDriver.Selenium, 0.3.0"
#:package WebViewDriver.Selenium@0.3.0
#addin nuget:?package=WebViewDriver.Selenium&version=0.3.0
#tool nuget:?package=WebViewDriver.Selenium&version=0.3.0
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 | Versions 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. |
-
net10.0
- Selenium.WebDriver (>= 4.30.0)
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.