Soenneker.Playwrights.Session
11.0.32
Prefix Reserved
dotnet add package Soenneker.Playwrights.Session --version 11.0.32
NuGet\Install-Package Soenneker.Playwrights.Session -Version 11.0.32
<PackageReference Include="Soenneker.Playwrights.Session" Version="11.0.32" />
<PackageVersion Include="Soenneker.Playwrights.Session" Version="11.0.32" />
<PackageReference Include="Soenneker.Playwrights.Session" />
paket add Soenneker.Playwrights.Session --version 11.0.32
#r "nuget: Soenneker.Playwrights.Session, 11.0.32"
#:package Soenneker.Playwrights.Session@11.0.32
#addin nuget:?package=Soenneker.Playwrights.Session&version=11.0.32
#tool nuget:?package=Soenneker.Playwrights.Session&version=11.0.32
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 | net11.0 is compatible. |
-
net11.0
- Microsoft.Playwright (>= 1.64.1)
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 |
|---|---|---|
| 11.0.32 | 264 | 11/11/2026 |
| 11.0.31 | 835 | 10/26/2026 |
| 4.0.30 | 306 | 10/23/2026 |
| 4.0.29 | 171 | 10/22/2026 |
| 4.0.28 | 326 | 10/14/2026 |
| 4.0.27 | 135 | 10/14/2026 |
| 4.0.22 | 158 | 10/12/2026 |
| 4.0.21 | 104 | 10/12/2026 |
| 4.0.20 | 331 | 10/11/2026 |
| 4.0.19 | 1,254 | 9/24/2026 |
| 4.0.18 | 190 | 9/24/2026 |
| 4.0.17 | 462 | 9/15/2026 |
| 4.0.16 | 654 | 9/12/2026 |
| 4.0.15 | 1,349 | 9/4/2026 |
| 4.0.14 | 701 | 8/30/2026 |
| 4.0.13 | 323 | 8/29/2026 |
| 4.0.12 | 129 | 8/29/2026 |
| 4.0.11 | 1,317 | 8/12/2026 |
| 4.0.10 | 1,452 | 7/27/2026 |
| 4.0.9 | 1,144 | 7/16/2026 |
Upgrade .NET 11 release candidates to stable