Soenneker.Playwrights.Session
4.0.30
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Playwrights.Session --version 4.0.30
NuGet\Install-Package Soenneker.Playwrights.Session -Version 4.0.30
<PackageReference Include="Soenneker.Playwrights.Session" Version="4.0.30" />
<PackageVersion Include="Soenneker.Playwrights.Session" Version="4.0.30" />
<PackageReference Include="Soenneker.Playwrights.Session" />
paket add Soenneker.Playwrights.Session --version 4.0.30
#r "nuget: Soenneker.Playwrights.Session, 4.0.30"
#:package Soenneker.Playwrights.Session@4.0.30
#addin nuget:?package=Soenneker.Playwrights.Session&version=4.0.30
#tool nuget:?package=Soenneker.Playwrights.Session&version=4.0.30
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.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.35 | 248 | 11/18/2026 |
| 11.0.34 | 132 | 11/18/2026 |
| 11.0.33 | 237 | 11/18/2026 |
| 11.0.32 | 606 | 11/11/2026 |
| 11.0.31 | 848 | 10/26/2026 |
| 4.0.30 | 308 | 10/23/2026 |
| 4.0.29 | 174 | 10/22/2026 |
| 4.0.28 | 333 | 10/14/2026 |
| 4.0.27 | 142 | 10/14/2026 |
| 4.0.22 | 161 | 10/12/2026 |
| 4.0.21 | 106 | 10/12/2026 |
| 4.0.20 | 332 | 10/11/2026 |
| 4.0.19 | 1,256 | 9/24/2026 |
| 4.0.18 | 195 | 9/24/2026 |
| 4.0.17 | 464 | 9/15/2026 |
| 4.0.16 | 659 | 9/12/2026 |
| 4.0.15 | 1,351 | 9/4/2026 |
| 4.0.14 | 707 | 8/30/2026 |
| 4.0.13 | 326 | 8/29/2026 |
| 4.0.12 | 132 | 8/29/2026 |
Update dependency Microsoft.Playwright to 1.64.1 (#176)
Automatically merged