Soenneker.Playwrights.Session
4.0.17
Prefix Reserved
dotnet add package Soenneker.Playwrights.Session --version 4.0.17
NuGet\Install-Package Soenneker.Playwrights.Session -Version 4.0.17
<PackageReference Include="Soenneker.Playwrights.Session" Version="4.0.17" />
<PackageVersion Include="Soenneker.Playwrights.Session" Version="4.0.17" />
<PackageReference Include="Soenneker.Playwrights.Session" />
paket add Soenneker.Playwrights.Session --version 4.0.17
#r "nuget: Soenneker.Playwrights.Session, 4.0.17"
#:package Soenneker.Playwrights.Session@4.0.17
#addin nuget:?package=Soenneker.Playwrights.Session&version=4.0.17
#tool nuget:?package=Soenneker.Playwrights.Session&version=4.0.17
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.17 | 291 | 9/15/2026 |
| 4.0.16 | 620 | 9/12/2026 |
| 4.0.15 | 1,324 | 9/4/2026 |
| 4.0.14 | 677 | 8/30/2026 |
| 4.0.13 | 299 | 8/29/2026 |
| 4.0.12 | 105 | 8/29/2026 |
| 4.0.11 | 1,291 | 8/12/2026 |
| 4.0.10 | 1,430 | 7/27/2026 |
| 4.0.9 | 1,122 | 7/16/2026 |
| 4.0.8 | 1,201 | 6/24/2026 |
| 4.0.7 | 526 | 6/19/2026 |
| 4.0.6 | 1,629 | 6/5/2026 |
| 4.0.5 | 117 | 6/5/2026 |
| 4.0.4 | 554 | 5/22/2026 |
| 4.0.3 | 1,683 | 4/22/2026 |
| 4.0.2 | 609 | 4/15/2026 |
| 4.0.1 | 394 | 4/13/2026 |