Soenneker.Playwrights.Session
4.0.14
Prefix Reserved
dotnet add package Soenneker.Playwrights.Session --version 4.0.14
NuGet\Install-Package Soenneker.Playwrights.Session -Version 4.0.14
<PackageReference Include="Soenneker.Playwrights.Session" Version="4.0.14" />
<PackageVersion Include="Soenneker.Playwrights.Session" Version="4.0.14" />
<PackageReference Include="Soenneker.Playwrights.Session" />
paket add Soenneker.Playwrights.Session --version 4.0.14
#r "nuget: Soenneker.Playwrights.Session, 4.0.14"
#:package Soenneker.Playwrights.Session@4.0.14
#addin nuget:?package=Soenneker.Playwrights.Session&version=4.0.14
#tool nuget:?package=Soenneker.Playwrights.Session&version=4.0.14
Soenneker.Playwrights.Session
An ownership-aware wrapper that keeps a Playwright browser context and its active page together behind IBrowserSession.
Installation
dotnet add package Soenneker.Playwrights.Session
Usage
Create a context and page, then return or pass them as one disposable session:
using Microsoft.Playwright;
using Soenneker.Playwrights.Session;
using Soenneker.Playwrights.Session.Abstract;
IBrowserContext context = await browser.NewContextAsync();
IPage page = await context.NewPageAsync();
await using IBrowserSession session = new BrowserSession(context, page);
await session.Page.GotoAsync("https://example.com");
string title = await session.Page.TitleAsync();
By default the session owns both objects. Disposing it disposes the context, which closes its pages.
When a context is shared elsewhere, explicitly borrow it and choose whether the session owns only the page:
await using IBrowserSession session = new BrowserSession(
sharedContext,
await sharedContext.NewPageAsync(),
ownsContext: false,
ownsPage: true);
Set both ownership flags to false when the caller manages both lifetimes. Disposing a session more than once is safe.
| 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
- Microsoft.Playwright (>= 1.62.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Playwrights.Session:
| Package | Downloads |
|---|---|
|
Soenneker.Playwrights.TestEnvironment
A test environment for testing with Playwright |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.14 | 25 | 8/30/2026 |
| 4.0.13 | 132 | 8/29/2026 |
| 4.0.12 | 48 | 8/29/2026 |
| 4.0.11 | 1,156 | 8/12/2026 |
| 4.0.10 | 1,421 | 7/27/2026 |
| 4.0.9 | 1,113 | 7/16/2026 |
| 4.0.8 | 1,194 | 6/24/2026 |
| 4.0.7 | 519 | 6/19/2026 |
| 4.0.6 | 1,624 | 6/5/2026 |
| 4.0.5 | 111 | 6/5/2026 |
| 4.0.4 | 549 | 5/22/2026 |
| 4.0.3 | 1,678 | 4/22/2026 |
| 4.0.2 | 604 | 4/15/2026 |
| 4.0.1 | 389 | 4/13/2026 |