Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dotnet/docs/api/class-apirequestcontext.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,8 @@ await ApiRequestContext.StorageStateAsync(options);

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.60</font><x-search>apiRequestContext.Tracing</x-search>

Tracing recorder for requests made through this API request context.

**Usage**

```csharp
Expand Down
6 changes: 6 additions & 0 deletions dotnet/docs/api/class-browser.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ await browser.CloseAsync();
- `Permissions` [IEnumerable]?&lt;[string]&gt; *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-new-context-option-permissions"/><a href="#browser-new-context-option-permissions" class="list-anchor">#</a>

A list of permissions to grant to all pages in this context. See [BrowserContext.GrantPermissionsAsync()](/api/class-browsercontext.mdx#browser-context-grant-permissions) for more details. Defaults to none.
- `PierceFrames` [bool]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-new-context-option-pierce-frames"/><a href="#browser-new-context-option-pierce-frames" class="list-anchor">#</a>

If set to true, all selectors in this context will pierce frames by default, as if every locator was created through [Page.PierceFrames()](/api/class-page.mdx#page-pierce-frames). Defaults to `false`.
- `Proxy` Proxy? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-new-context-option-proxy"/><a href="#browser-new-context-option-proxy" class="list-anchor">#</a>
- `Server` [string]

Expand Down Expand Up @@ -533,6 +536,9 @@ await Browser.NewPageAsync(options);
- `Permissions` [IEnumerable]?&lt;[string]&gt; *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-new-page-option-permissions"/><a href="#browser-new-page-option-permissions" class="list-anchor">#</a>

A list of permissions to grant to all pages in this context. See [BrowserContext.GrantPermissionsAsync()](/api/class-browsercontext.mdx#browser-context-grant-permissions) for more details. Defaults to none.
- `PierceFrames` [bool]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-new-page-option-pierce-frames"/><a href="#browser-new-page-option-pierce-frames" class="list-anchor">#</a>

If set to true, all selectors in this context will pierce frames by default, as if every locator was created through [Page.PierceFrames()](/api/class-page.mdx#page-pierce-frames). Defaults to `false`.
- `Proxy` Proxy? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-new-page-option-proxy"/><a href="#browser-new-page-option-proxy" class="list-anchor">#</a>
- `Server` [string]

Expand Down
3 changes: 3 additions & 0 deletions dotnet/docs/api/class-browsertype.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options);
- `Permissions` [IEnumerable]?&lt;[string]&gt; *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-persistent-context-option-permissions"/><a href="#browser-type-launch-persistent-context-option-permissions" class="list-anchor">#</a>

A list of permissions to grant to all pages in this context. See [BrowserContext.GrantPermissionsAsync()](/api/class-browsercontext.mdx#browser-context-grant-permissions) for more details. Defaults to none.
- `PierceFrames` [bool]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-persistent-context-option-pierce-frames"/><a href="#browser-type-launch-persistent-context-option-pierce-frames" class="list-anchor">#</a>

If set to true, all selectors in this context will pierce frames by default, as if every locator was created through [Page.PierceFrames()](/api/class-page.mdx#page-pierce-frames). Defaults to `false`.
- `Proxy` Proxy? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="browser-type-launch-persistent-context-option-proxy"/><a href="#browser-type-launch-persistent-context-option-proxy" class="list-anchor">#</a>
- `Server` [string]

Expand Down
6 changes: 6 additions & 0 deletions dotnet/docs/api/class-frame.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,12 @@ var locator = frame.PierceFrames.GetByRole(AriaRole.Button);
await locator.ClickAsync();
```

**Arguments**
- `options` `FramePierceFramesOptions?` *(optional)*
- `Pierce` [bool]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="frame-pierce-frames-option-pierce"/><a href="#frame-pierce-frames-option-pierce" class="list-anchor">#</a>

Whether to pierce frames. Pass `false` to opt out of frame piercing enabled by the [PierceFrames](/api/class-browser.mdx#browser-new-context-option-pierce-frames) context option. Defaults to `true`.

**Returns**
- [FrameLocator]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="frame-pierce-frames-return"/><a href="#frame-pierce-frames-return" class="list-anchor">#</a>

Expand Down
6 changes: 6 additions & 0 deletions dotnet/docs/api/class-page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,12 @@ var locator = page.PierceFrames.GetByRole(AriaRole.Button);
await locator.ClickAsync();
```

**Arguments**
- `options` `PagePierceFramesOptions?` *(optional)*
- `Pierce` [bool]? *(optional)*<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="page-pierce-frames-option-pierce"/><a href="#page-pierce-frames-option-pierce" class="list-anchor">#</a>

Whether to pierce frames. Pass `false` to opt out of frame piercing enabled by the [PierceFrames](/api/class-browser.mdx#browser-new-context-option-pierce-frames) context option. Defaults to `true`.

**Returns**
- [FrameLocator]<a aria-hidden="true" tabIndex="-1" class="list-anchor-link" id="page-pierce-frames-return"/><a href="#page-pierce-frames-return" class="list-anchor">#</a>

Expand Down
2 changes: 1 addition & 1 deletion dotnet/docs/api/class-tracing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ await context.Tracing.StopChunkAsync(new()

Start recording a HAR (HTTP Archive) of network activity in this context. The HAR file is written to disk when [Tracing.StopHarAsync()](/api/class-tracing.mdx#tracing-stop-har) is called, or when the returned [Disposable] is disposed.

Only one HAR recording can be active at a time per [BrowserContext].
Only one HAR recording can be active at a time per [Tracing] instance.

**Usage**

Expand Down
2 changes: 1 addition & 1 deletion dotnet/docs/browsers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ See [system requirements](./intro.mdx#system-requirements) for officially suppor

## Configure Browsers

Playwright can run tests on Chromium, WebKit and Firefox browsers as well as branded browsers such as Google Chrome and Microsoft Edge. It can also run on emulated tablet and mobile devices. See the [registry of device parameters](https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/deviceDescriptorsSource.json) for a complete list of selected desktop, tablet and mobile devices.
Playwright can run tests on Chromium, WebKit and Firefox browsers as well as branded browsers such as Google Chrome and Microsoft Edge. It can also run on emulated tablet and mobile devices. See the [registry of device parameters](https://github.com/microsoft/playwright/blob/main/packages/isomorphic/deviceDescriptorsSource.json) for a complete list of selected desktop, tablet and mobile devices.

### Run tests on different browsers

Expand Down
10 changes: 5 additions & 5 deletions dotnet/docs/ci.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
name: 'Playwright Tests'
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright/dotnet:v1.61.0-noble
image: mcr.microsoft.com/playwright/dotnet:v1.62.0-noble
options: --user 1001
steps:
- uses: actions/checkout@v6
Expand Down Expand Up @@ -159,7 +159,7 @@ trigger:

pool:
vmImage: ubuntu-latest
container: mcr.microsoft.com/playwright/dotnet:v1.61.0-noble
container: mcr.microsoft.com/playwright/dotnet:v1.62.0-noble

steps:
- task: UseDotNet@2
Expand All @@ -182,7 +182,7 @@ Running Playwright on CircleCI is very similar to running on GitHub Actions. In
executors:
pw-noble-development:
docker:
- image: mcr.microsoft.com/playwright/dotnet:v1.61.0-noble
- image: mcr.microsoft.com/playwright/dotnet:v1.62.0-noble
```

Note: When using the docker agent definition, you are specifying the resource class of where playwright runs to the 'medium' tier [here](https://circleci.com/docs/configuration-reference?#docker-execution-environment). The default behavior of Playwright is to set the number of workers to the detected core count (2 in the case of the medium tier). Overriding the number of workers to greater than this number will cause unnecessary timeouts and failures.
Expand All @@ -193,7 +193,7 @@ Jenkins supports Docker agents for pipelines. Use the [Playwright Docker image](

```groovy
pipeline {
agent { docker { image 'mcr.microsoft.com/playwright/dotnet:v1.61.0-noble' } }
agent { docker { image 'mcr.microsoft.com/playwright/dotnet:v1.62.0-noble' } }
stages {
stage('e2e-tests') {
steps {
Expand All @@ -210,7 +210,7 @@ pipeline {
Bitbucket Pipelines can use public [Docker images as build environments](https://confluence.atlassian.com/bitbucket/use-docker-images-as-build-environments-792298897.html). To run Playwright tests on Bitbucket, use our public Docker image ([see Dockerfile](./docker.mdx)).

```yml
image: mcr.microsoft.com/playwright/dotnet:v1.61.0-noble
image: mcr.microsoft.com/playwright/dotnet:v1.62.0-noble
```

### GitLab CI
Expand Down
18 changes: 9 additions & 9 deletions dotnet/docs/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This Docker image is intended to be used for testing and development purposes on
### Pull the image

```bash
docker pull mcr.microsoft.com/playwright/dotnet:v1.61.0-noble
docker pull mcr.microsoft.com/playwright/dotnet:v1.62.0-noble
```

### Run the image
Expand All @@ -34,15 +34,15 @@ By default, the Docker image will use the `root` user to run the browsers. This
On trusted websites, you can avoid creating a separate user and use root for it since you trust the code which will run on the browsers.

```bash
docker run -it --rm --ipc=host mcr.microsoft.com/playwright/dotnet:v1.61.0-noble /bin/bash
docker run -it --rm --ipc=host mcr.microsoft.com/playwright/dotnet:v1.62.0-noble /bin/bash
```

#### Crawling and scraping

On untrusted websites, it's recommended to use a separate user for launching the browsers in combination with the seccomp profile. Inside the container or if you are using the Docker image as a base image you have to use `adduser` for it.

```bash
docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/dotnet:v1.61.0-noble /bin/bash
docker run -it --rm --ipc=host --user pwuser --security-opt seccomp=seccomp_profile.json mcr.microsoft.com/playwright/dotnet:v1.62.0-noble /bin/bash
```

[`seccomp_profile.json`](https://github.com/microsoft/playwright/blob/main/utils/docker/seccomp_profile.json) is needed to run Chromium with sandbox. This is a [default Docker seccomp profile](https://github.com/docker/engine/blob/d0d99b04cf6e00ed3fc27e81fc3d94e7eda70af3/profiles/seccomp/default.json) with extra user namespace cloning permissions:
Expand Down Expand Up @@ -82,7 +82,7 @@ You can run Playwright Server in Docker while keeping your tests running on the
Start the Playwright Server in Docker:

```bash
docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.61.0-noble /bin/sh -c "npx -y playwright@1.61.0 run-server --port 3000 --host 0.0.0.0"
docker run -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.62.0-noble /bin/sh -c "npx -y playwright@1.62.0 run-server --port 3000 --host 0.0.0.0"
```

#### Connecting to the Server
Expand All @@ -99,7 +99,7 @@ await using var browser = await playwright.Chromium.ConnectAsync("ws://127.0.0.1
If you need to access local servers from within the Docker container:

```bash
docker run --add-host=hostmachine:host-gateway -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.61.0-noble /bin/sh -c "npx -y playwright@1.61.0 run-server --port 3000 --host 0.0.0.0"
docker run --add-host=hostmachine:host-gateway -p 3000:3000 --rm --init -it --workdir /home/pwuser --user pwuser mcr.microsoft.com/playwright:v1.62.0-noble /bin/sh -c "npx -y playwright@1.62.0 run-server --port 3000 --host 0.0.0.0"
```

This makes `hostmachine` point to the host's localhost. Your tests should use `hostmachine` instead of `localhost` when accessing local servers.
Expand Down Expand Up @@ -132,10 +132,10 @@ Once this is enabled you can open the port specified in a new browser tab and yo
See [all available image tags].

We currently publish images with the following tags:
- `:v1.61.0` - Playwright v1.61.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
- `:v1.61.0-noble` - Playwright v1.61.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
- `:v1.61.0-jammy` - Playwright v1.61.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
- `:v1.61.0-resolute` - Playwright v1.61.0 release docker image based on Ubuntu 26.04 LTS (Resolute Raccoon).
- `:v1.62.0` - Playwright v1.62.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
- `:v1.62.0-noble` - Playwright v1.62.0 release docker image based on Ubuntu 24.04 LTS (Noble Numbat).
- `:v1.62.0-jammy` - Playwright v1.62.0 release docker image based on Ubuntu 22.04 LTS (Jammy Jellyfish).
- `:v1.62.0-resolute` - Playwright v1.62.0 release docker image based on Ubuntu 26.04 LTS (Resolute Raccoon).

:::note

Expand Down
2 changes: 1 addition & 1 deletion dotnet/docs/emulation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ With Playwright you can test your app on any browser as well as emulate a real d

## Devices

Playwright comes with a [registry of device parameters](https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/deviceDescriptorsSource.json) using [Playwright.Devices](/api/class-playwright.mdx#playwright-devices) for selected desktop, tablet and mobile devices. It can be used to simulate browser behavior for a specific device such as user agent, screen size, viewport and if it has touch enabled. All tests will run with the specified device parameters.
Playwright comes with a [registry of device parameters](https://github.com/microsoft/playwright/blob/main/packages/isomorphic/deviceDescriptorsSource.json) using [Playwright.Devices](/api/class-playwright.mdx#playwright-devices) for selected desktop, tablet and mobile devices. It can be used to simulate browser behavior for a specific device such as user agent, screen size, viewport and if it has touch enabled. All tests will run with the specified device parameters.

```csharp
using Microsoft.Playwright;
Expand Down
43 changes: 37 additions & 6 deletions dotnet/docs/getting-started-cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,30 @@ Playwright comes with `playwright-cli`, a command-line interface for browser aut
## Prerequisites

Before you begin, make sure you have the following installed:
- [Node.js](https://nodejs.org/) 20 or newer
- Playwright for your language, **or** [Node.js](https://nodejs.org/) 20+ for the standalone `@playwright/cli` package
- A coding agent: Claude Code, GitHub Copilot, or similar

## Installation

Install `playwright-cli` globally:
Install the standalone CLI globally (works with any language):

```bash
npm install -g @playwright/cli@latest
playwright-cli --help
```

Alternatively, install `@playwright/cli` as a local dependency and use `npx`:
Or use the CLI bundled with your Playwright install:

```bash
npm install -D @playwright/cli@latest
npx playwright-cli --help
# JavaScript / TypeScript
npx playwright cli --help

# Python
python -m playwright cli --help
```

When using a bundled entry point, replace `playwright-cli` with `npx playwright cli` or `python -m playwright cli` in the commands below.

### Installing skills

Coding agents like Claude Code and GitHub Copilot can use locally installed skills for richer context about available commands:
Expand All @@ -44,6 +49,12 @@ Coding agents like Claude Code and GitHub Copilot can use locally installed skil
playwright-cli install --skills
```

To share the skills across all your projects, add the `-g` flag to install them into your home directory (`~/.claude/skills` or, with `--skills=agents`, `~/.agents/skills`):

```bash
playwright-cli install --skills -g
```

### Skills-less operation

You can also point your agent at the CLI directly and let it discover commands on its own:
Expand Down Expand Up @@ -103,7 +114,7 @@ playwright-cli check <ref> # check a checkbox or radio button
playwright-cli uncheck <ref> # uncheck a checkbox
playwright-cli hover <ref> # hover over element
playwright-cli drag <startRef> <endRef> # drag and drop between elements
playwright-cli upload <file> # upload files
playwright-cli upload <files...> # upload one or multiple files
playwright-cli close # close the page
```

Expand Down Expand Up @@ -289,11 +300,29 @@ playwright-cli attach --extension

This requires the [Playwright Extension](https://github.com/microsoft/playwright/blob/main/packages/extension/README.md) to be installed.

## Debugging tests

Coding agents can pause a test at the start, attach with `playwright-cli`, and explore the live browser — useful for diagnosing and fixing failures.

```bash
# JavaScript / TypeScript
PLAYWRIGHT_HTML_OPEN=never npx playwright test --debug=cli
# → Debugging Instructions with session name, e.g. tw-abcdef
playwright-cli attach tw-abcdef

# Python (pytest-playwright; -s keeps the attach line visible)
pytest --playwright-debug=cli -s
playwright-cli attach tw-abcdef
```

Keep the test running in the background while you attach. The installed skill documents this workflow for agents.

## Quick Reference

| Action | Command |
| ------------------------- | --------------------------------------------------- |
| **Install CLI** | `npm install -g @playwright/cli@latest` |
| **Use bundled CLI** | `npx playwright cli …` / `python -m playwright cli …` |
| **Install skills** | `playwright-cli install --skills` |
| **Open a page** | `playwright-cli open https://example.com` |
| **Click an element** | `playwright-cli click e15` |
Expand All @@ -303,6 +332,8 @@ This requires the [Playwright Extension](https://github.com/microsoft/playwright
| **Run headed** | `playwright-cli open https://example.com --headed` |
| **Use Firefox** | `playwright-cli open --browser=firefox` |
| **Monitor sessions** | `playwright-cli show` |
| **Debug JS test** | `npx playwright test --debug=cli` |
| **Debug Python test** | `pytest --playwright-debug=cli -s` |

## What's Next
- [Write tests using web-first assertions, page fixtures, and locators](./writing-tests.mdx)
Expand Down
28 changes: 28 additions & 0 deletions dotnet/docs/release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,34 @@ import HTMLCard from '@site/src/components/HTMLCard';

import LiteYouTube from '@site/src/components/LiteYouTube';

## Version 1.62

### 🖼️ WebP screenshots

[Page.ScreenshotAsync()](/api/class-page.mdx#page-screenshot) and [Locator.ScreenshotAsync()](/api/class-locator.mdx#locator-screenshot) can now capture screenshots in the WebP format — Playwright infers the format from a `.webp` file extension, or you can set the `type` explicitly. Quality `100` (the default) is lossless, while lower values use lossy compression:

```csharp
await page.ScreenshotAsync(new() { Path = "homepage.webp", Quality = 50 });
```

### New APIs
- New `scroll` option (`"auto"` | `"none"`) on actions to opt out of Playwright's automatic scroll-into-view.
- New [Locator.WaitForFunctionAsync()](/api/class-locator.mdx#locator-wait-for-function) waits until a function — called with the matching element — returns a truthy value.
- New [ApiResponse.Timing](/api/class-apiresponse.mdx#api-response-timing) returns resource timing information for an API response.

### Announcements
* 📋 The clipboard is now isolated from the operating system in headless mode, so tests that use `navigator.clipboard` no longer read or overwrite the clipboard of the machine running them.
* ⚠️ Debian 11 is not supported anymore.

### Browser Versions
- Chromium 151.0.7922.34
- Mozilla Firefox 153.0
- WebKit 26.5

This version was also tested against the following stable channels:
- Google Chrome 151
- Microsoft Edge 151

## Version 1.61

### 🔑 WebAuthn passkeys
Expand Down
2 changes: 2 additions & 0 deletions java/docs/api/class-apirequestcontext.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ APIRequestContext.storageState(options);

<font size="2" style={{position: "relative", top: "-20px"}}>Added in: v1.60</font><x-search>apiRequestContext.tracing()</x-search>

Tracing recorder for requests made through this API request context.

**Usage**

```java
Expand Down
Loading
Loading