Azure.Developer.Playwright.NUnit 1.0.0

Prefix Reserved
dotnet add package Azure.Developer.Playwright.NUnit --version 1.0.0
                    
NuGet\Install-Package Azure.Developer.Playwright.NUnit -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Azure.Developer.Playwright.NUnit" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Azure.Developer.Playwright.NUnit" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Azure.Developer.Playwright.NUnit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Azure.Developer.Playwright.NUnit --version 1.0.0
                    
#r "nuget: Azure.Developer.Playwright.NUnit, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Azure.Developer.Playwright.NUnit@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Azure.Developer.Playwright.NUnit&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Azure.Developer.Playwright.NUnit&version=1.0.0
                    
Install as a Cake Tool

Azure Playwright NUnit client library for .NET

Azure Playwright is a fully managed service that uses the cloud to enable you to run Playwright tests with much higher parallelization across different operating system-browser combinations simultaneously. This means faster test runs with broader scenario coverage, which helps speed up delivery of features without sacrificing quality. With Azure Playwright, you can release features faster and more confidently.

Ready to get started? Jump into our quickstart guide!

Getting started

Install the package

Install the client library for .NET with NuGet:

dotnet add package Azure.Developer.Playwright.NUnit

Prerequisites

Authenticate the client

To learn more about options for Microsoft Entra Id authentication, refer to Azure.Identity credentials.

Create a Workspace
  1. Sign in to the Azure portal with your Azure account.

  2. Create the Workspace.

    • Select the menu button in the upper-left corner of the portal, and then select Create a resource.

      Create a resource in Azure portal

    • Enter Playwright Workspaces in the search box.

    • Select the Playwright Workspaces card, and then select Create.

      Search for Playwright Workspaces in Azure Marketplace

    • Provide the following information to configure a new Playwright workspace:

      Field Description
      Subscription Select the Azure subscription that you want to use for this Playwright workspace.
      Resource group Select an existing resource group. Or select Create new, and then enter a unique name for the new resource group.
      Name Enter a unique name to identify your workspace.<br/>The name can only consist of alphanumerical characters, and have a length between 3 and 64 characters.
      Location Select a geographic location to host your workspace.<br/>This location also determines where the test execution results are stored.

      Optionally, you can configure more details on the Tags tab. Tags are name/value pairs that enable you to categorize resources and view consolidated billing by applying the same tag to multiple resources and resource groups.

    • After you're finished configuring the resource, select Review + Create.

    • Review all the configuration settings and select Create to start the deployment of the Playwright workspace.

    • When the process has finished, a deployment success message appears.

    • To view the new workspace, select Go to resource.

      Deployment complete - Go to resource |

If you don't see this screen, select an existing workspace and go to the next section.

```

Set up Azure Playwright

Create a file PlaywrightServiceSetup.cs in the root directory with the below content

using Azure.Developer.Playwright.NUnit;
using Azure.Identity;

namespace PlaywrightService.SampleTests; // Remember to change this as per your project namespace

[SetUpFixture]
public class PlaywrightServiceNUnitSetup : PlaywrightServiceBrowserNUnit
{
    public PlaywrightServiceNUnitSetup() : base(
        credential: new DefaultAzureCredential()
    )
    { }
}

Setup Azure Playwright cloud browser connection

Override builtin PageTest fixture with Azure Playwright cloud browser connection and use ServicePageTest in all test classes.

using Microsoft.Playwright.NUnit;
using Azure.Developer.Playwright;
using Azure.Identity;
using Microsoft.Playwright;

namespace PlaywrightService.SampleTests;

public class ServicePageTest : PageTest
{
    public override async Task<(string, BrowserTypeConnectOptions?)?> ConnectOptionsAsync()
    {
        PlaywrightServiceBrowserClient client = new PlaywrightServiceBrowserClient(credential: new DefaultAzureCredential());
        var connectOptions = await client.GetConnectOptionsAsync<BrowserTypeConnectOptions>();
        return (connectOptions.WsEndpoint, connectOptions.Options);
    }
}

Make sure your project uses Microsoft.Playwright.NUnit version 1.50.0 or above.

Obtain region endpoint

  1. In the Playwright portal, copy the command under Add region endpoint in your set up.

    Set workspace endpoint

    The endpoint URL corresponds to the workspace region. You might see a different endpoint URL in the Playwright portal, depending on the region you selected when creating the workspace.

Set up environment

Ensure that the PLAYWRIGHT_SERVICE_URL that you obtained in previous step is available in your environment.

Run the tests

Run Playwright tests against browsers managed by the service using the configuration you created above.

dotnet test

Key concepts

Key concepts of the Azure Playwright NUnit SDK for .NET can be found here

Examples

Code samples for using this SDK can be found in the following locations

Troubleshooting

Next steps

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit [cla.microsoft.com][cla].

This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 341 8/29/2025
1.0.0-beta.2 527 8/6/2025
1.0.0-beta.1 160 7/1/2025