From f3fee7cbebe947537a5ed69630ad9b4e523e6085 Mon Sep 17 00:00:00 2001
From: "microsoft-playwright-automation[bot]"
<203992400+microsoft-playwright-automation[bot]@users.noreply.github.com>
Date: Wed, 4 Mar 2026 10:20:33 +0000
Subject: [PATCH] feat(roll): roll to ToT Playwright (04-03-26)
---
dotnet/docs/api/class-browsertype.mdx | 6 +
dotnet/docs/api/class-response.mdx | 17 ++
dotnet/docs/browsers.mdx | 4 +-
dotnet/docs/ci-intro.mdx | 2 +-
dotnet/docs/codegen.mdx | 14 +-
dotnet/docs/debug.mdx | 14 +-
dotnet/docs/emulation.mdx | 8 +-
dotnet/docs/other-locators.mdx | 20 +-
dotnet/docs/trace-viewer.mdx | 2 +-
java/docs/api/class-browsertype.mdx | 6 +
java/docs/api/class-response.mdx | 17 ++
java/docs/browsers.mdx | 4 +-
java/docs/ci-intro.mdx | 2 +-
java/docs/codegen.mdx | 14 +-
java/docs/debug.mdx | 14 +-
java/docs/emulation.mdx | 6 +-
java/docs/other-locators.mdx | 20 +-
java/docs/trace-viewer.mdx | 2 +-
nodejs/docs/accessibility-testing.mdx | 1 +
nodejs/docs/actionability.mdx | 1 +
nodejs/docs/api-testing.mdx | 1 +
nodejs/docs/api/class-android.mdx | 1 +
nodejs/docs/api/class-androiddevice.mdx | 1 +
nodejs/docs/api/class-androidinput.mdx | 1 +
nodejs/docs/api/class-androidsocket.mdx | 1 +
nodejs/docs/api/class-androidwebview.mdx | 1 +
nodejs/docs/api/class-apirequest.mdx | 1 +
nodejs/docs/api/class-apirequestcontext.mdx | 1 +
nodejs/docs/api/class-apiresponse.mdx | 1 +
.../docs/api/class-apiresponseassertions.mdx | 1 +
nodejs/docs/api/class-browser.mdx | 1 +
nodejs/docs/api/class-browsercontext.mdx | 1 +
nodejs/docs/api/class-browserserver.mdx | 1 +
nodejs/docs/api/class-browsertype.mdx | 10 +
nodejs/docs/api/class-cdpsession.mdx | 1 +
nodejs/docs/api/class-clock.mdx | 1 +
nodejs/docs/api/class-consolemessage.mdx | 1 +
nodejs/docs/api/class-coverage.mdx | 1 +
nodejs/docs/api/class-dialog.mdx | 1 +
nodejs/docs/api/class-download.mdx | 1 +
nodejs/docs/api/class-electron.mdx | 1 +
nodejs/docs/api/class-electronapplication.mdx | 1 +
nodejs/docs/api/class-elementhandle.mdx | 1 +
nodejs/docs/api/class-filechooser.mdx | 1 +
nodejs/docs/api/class-fixtures.mdx | 1 +
nodejs/docs/api/class-frame.mdx | 1 +
nodejs/docs/api/class-framelocator.mdx | 1 +
nodejs/docs/api/class-fullconfig.mdx | 1 +
nodejs/docs/api/class-fullproject.mdx | 1 +
nodejs/docs/api/class-genericassertions.mdx | 1 +
nodejs/docs/api/class-inspector.mdx | 245 ++++++++++++++++++
nodejs/docs/api/class-jshandle.mdx | 1 +
nodejs/docs/api/class-keyboard.mdx | 1 +
nodejs/docs/api/class-location.mdx | 1 +
nodejs/docs/api/class-locator.mdx | 1 +
nodejs/docs/api/class-locatorassertions.mdx | 1 +
nodejs/docs/api/class-logger.mdx | 1 +
nodejs/docs/api/class-mouse.mdx | 1 +
nodejs/docs/api/class-page.mdx | 24 ++
nodejs/docs/api/class-pageagent.mdx | 1 +
nodejs/docs/api/class-pageassertions.mdx | 1 +
nodejs/docs/api/class-playwright.mdx | 1 +
.../docs/api/class-playwrightassertions.mdx | 1 +
nodejs/docs/api/class-reporter.mdx | 1 +
nodejs/docs/api/class-request.mdx | 1 +
nodejs/docs/api/class-response.mdx | 18 ++
nodejs/docs/api/class-route.mdx | 1 +
nodejs/docs/api/class-selectors.mdx | 1 +
nodejs/docs/api/class-snapshotassertions.mdx | 1 +
nodejs/docs/api/class-suite.mdx | 1 +
nodejs/docs/api/class-test.mdx | 1 +
nodejs/docs/api/class-testcase.mdx | 1 +
nodejs/docs/api/class-testconfig.mdx | 1 +
nodejs/docs/api/class-testerror.mdx | 1 +
nodejs/docs/api/class-testinfo.mdx | 1 +
nodejs/docs/api/class-testinfoerror.mdx | 1 +
nodejs/docs/api/class-testoptions.mdx | 6 +-
nodejs/docs/api/class-testproject.mdx | 1 +
nodejs/docs/api/class-testresult.mdx | 1 +
nodejs/docs/api/class-teststep.mdx | 1 +
nodejs/docs/api/class-teststepinfo.mdx | 1 +
nodejs/docs/api/class-timeouterror.mdx | 1 +
nodejs/docs/api/class-touchscreen.mdx | 1 +
nodejs/docs/api/class-tracing.mdx | 1 +
nodejs/docs/api/class-video.mdx | 1 +
nodejs/docs/api/class-weberror.mdx | 1 +
nodejs/docs/api/class-websocket.mdx | 1 +
nodejs/docs/api/class-websocketroute.mdx | 1 +
nodejs/docs/api/class-worker.mdx | 1 +
nodejs/docs/api/class-workerinfo.mdx | 1 +
nodejs/docs/aria-snapshots.mdx | 1 +
nodejs/docs/auth.mdx | 1 +
nodejs/docs/best-practices.mdx | 17 +-
nodejs/docs/browser-contexts.mdx | 1 +
nodejs/docs/browsers.mdx | 5 +-
nodejs/docs/canary-releases.mdx | 1 +
nodejs/docs/chrome-extensions.mdx | 1 +
nodejs/docs/ci-intro.mdx | 5 +-
nodejs/docs/ci.mdx | 1 +
nodejs/docs/clock.mdx | 1 +
nodejs/docs/codegen-intro.mdx | 1 +
nodejs/docs/codegen.mdx | 21 +-
nodejs/docs/debug.mdx | 33 +--
nodejs/docs/dialogs.mdx | 1 +
nodejs/docs/docker.mdx | 1 +
nodejs/docs/downloads.mdx | 1 +
nodejs/docs/emulation.mdx | 9 +-
nodejs/docs/evaluating.mdx | 1 +
nodejs/docs/events.mdx | 1 +
nodejs/docs/extensibility.mdx | 1 +
nodejs/docs/frames.mdx | 1 +
nodejs/docs/getting-started-vscode.mdx | 1 +
nodejs/docs/handles.mdx | 1 +
nodejs/docs/input.mdx | 1 +
nodejs/docs/intro.mdx | 1 +
nodejs/docs/languages.mdx | 1 +
nodejs/docs/library.mdx | 1 +
nodejs/docs/locators.mdx | 1 +
nodejs/docs/mock-browser.mdx | 1 +
nodejs/docs/mock.mdx | 1 +
nodejs/docs/navigations.mdx | 1 +
nodejs/docs/network.mdx | 1 +
nodejs/docs/other-locators.mdx | 21 +-
nodejs/docs/pages.mdx | 1 +
nodejs/docs/pom.mdx | 1 +
nodejs/docs/protractor.mdx | 1 +
nodejs/docs/puppeteer.mdx | 1 +
nodejs/docs/release-notes.mdx | 1 +
nodejs/docs/running-tests.mdx | 1 +
nodejs/docs/screenshots.mdx | 1 +
nodejs/docs/selenium-grid.mdx | 1 +
nodejs/docs/service-workers.mdx | 1 +
nodejs/docs/test-agents.mdx | 1 +
nodejs/docs/test-annotations.mdx | 1 +
nodejs/docs/test-assertions.mdx | 1 +
nodejs/docs/test-cli.mdx | 3 +-
nodejs/docs/test-components.mdx | 1 +
nodejs/docs/test-configuration.mdx | 1 +
nodejs/docs/test-fixtures.mdx | 1 +
nodejs/docs/test-global-setup-teardown.mdx | 1 +
nodejs/docs/test-parallel.mdx | 1 +
nodejs/docs/test-parameterize.mdx | 1 +
nodejs/docs/test-projects.mdx | 11 +-
nodejs/docs/test-reporters.mdx | 1 +
nodejs/docs/test-retries.mdx | 1 +
nodejs/docs/test-sharding.mdx | 3 +-
nodejs/docs/test-snapshots.mdx | 1 +
nodejs/docs/test-timeouts.mdx | 1 +
nodejs/docs/test-typescript.mdx | 1 +
nodejs/docs/test-ui-mode.mdx | 1 +
nodejs/docs/test-use-options.mdx | 1 +
nodejs/docs/test-webserver.mdx | 1 +
nodejs/docs/testing-library.mdx | 1 +
nodejs/docs/touch-events.mdx | 1 +
nodejs/docs/trace-viewer-intro.mdx | 1 +
nodejs/docs/trace-viewer.mdx | 3 +-
nodejs/docs/videos.mdx | 1 +
nodejs/docs/webview2.mdx | 1 +
nodejs/docs/writing-tests.mdx | 1 +
python/docs/api/class-browsertype.mdx | 6 +
python/docs/api/class-response.mdx | 17 ++
python/docs/browsers.mdx | 4 +-
python/docs/ci-intro.mdx | 2 +-
python/docs/codegen.mdx | 14 +-
python/docs/debug.mdx | 14 +-
python/docs/emulation.mdx | 8 +-
python/docs/other-locators.mdx | 20 +-
python/docs/trace-viewer.mdx | 2 +-
168 files changed, 681 insertions(+), 137 deletions(-)
create mode 100644 nodejs/docs/api/class-inspector.mdx
diff --git a/dotnet/docs/api/class-browsertype.mdx b/dotnet/docs/api/class-browsertype.mdx
index c5c1a16114a..432477d3ec0 100644
--- a/dotnet/docs/api/class-browsertype.mdx
+++ b/dotnet/docs/api/class-browsertype.mdx
@@ -180,6 +180,9 @@ var browser = await playwright.Chromium.LaunchAsync(new() {
:::
Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/).
+ - `ArtifactsDir` [string]? *(optional)*#
+
+ If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes.
- `Channel` [string]? *(optional)*#
Browser distribution channel.
@@ -292,6 +295,9 @@ await BrowserType.LaunchPersistentContextAsync(userDataDir, options);
:::
Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/).
+ - `ArtifactsDir` [string]? *(optional)*#
+
+ If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes.
- `BaseURL` [string]? *(optional)*#
When using [Page.GotoAsync()](/api/class-page.mdx#page-goto), [Page.RouteAsync()](/api/class-page.mdx#page-route), [Page.WaitForURLAsync()](/api/class-page.mdx#page-wait-for-url), [Page.RunAndWaitForRequestAsync()](/api/class-page.mdx#page-wait-for-request), or [Page.RunAndWaitForResponseAsync()](/api/class-page.mdx#page-wait-for-response) it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples:
diff --git a/dotnet/docs/api/class-response.mdx b/dotnet/docs/api/class-response.mdx
index 242eeee91c6..db5dc9b35d4 100644
--- a/dotnet/docs/api/class-response.mdx
+++ b/dotnet/docs/api/class-response.mdx
@@ -183,6 +183,23 @@ await Response.HeadersArrayAsync();
---
+### HttpVersionAsync {#response-http-version}
+
+Added in: v1.59response.HttpVersionAsync
+
+Returns the http version used by the response.
+
+**Usage**
+
+```csharp
+await Response.HttpVersionAsync();
+```
+
+**Returns**
+- [string]#
+
+---
+
### JsonAsync {#response-json}
Added before v1.9response.JsonAsync
diff --git a/dotnet/docs/browsers.mdx b/dotnet/docs/browsers.mdx
index f89323bbf74..03fb7ef1947 100644
--- a/dotnet/docs/browsers.mdx
+++ b/dotnet/docs/browsers.mdx
@@ -462,7 +462,7 @@ pwsh bin/Debug/netX/playwright.ps1 install
-When running Playwright scripts, ask it to search for browsers in a shared location.
+When running Playwright scripts, ask Playwright to search for browsers in a shared location.
+
## Viewing Test Logs
diff --git a/dotnet/docs/codegen.mdx b/dotnet/docs/codegen.mdx
index c537b13fff5..b0d679bf269 100644
--- a/dotnet/docs/codegen.mdx
+++ b/dotnet/docs/codegen.mdx
@@ -67,7 +67,7 @@ pwsh bin/Debug/netX/playwright.ps1 codegen --viewport-size="800,600" playwright.
```
######
-
+
### Emulate devices
@@ -78,7 +78,7 @@ pwsh bin/Debug/netX/playwright.ps1 codegen --device="iPhone 13" playwright.dev
```
######
-
+
### Emulate color scheme
@@ -89,7 +89,7 @@ pwsh bin/Debug/netX/playwright.ps1 codegen --color-scheme=dark playwright.dev
```
######
-
+
### Emulate geolocation, language and timezone
@@ -102,7 +102,7 @@ pwsh bin/Debug/netX/playwright.ps1 codegen --timezone="Europe/Rome" --geolocatio
```
######
-
+
### Preserve authenticated state
@@ -113,13 +113,13 @@ pwsh bin/Debug/netX/playwright.ps1 codegen github.com/microsoft/playwright --sav
```
######
-
+
#### Login
After performing authentication and closing the browser, `auth.json` will contain the storage state which you can then reuse in your tests.
-
+
Make sure you only use the `auth.json` locally as it contains sensitive information. Add it to your `.gitignore` or delete it once you have finished generating your tests.
@@ -132,7 +132,7 @@ pwsh bin/Debug/netX/playwright.ps1 codegen --load-storage=auth.json github.com/m
```
######
-
+
#### Use existing userDataDir
diff --git a/dotnet/docs/debug.mdx b/dotnet/docs/debug.mdx
index 4488ed6efe9..eb7bf1816a4 100644
--- a/dotnet/docs/debug.mdx
+++ b/dotnet/docs/debug.mdx
@@ -10,7 +10,7 @@ import HTMLCard from '@site/src/components/HTMLCard';
The Playwright Inspector is a GUI tool to help you debug your Playwright tests. It allows you to step through your tests, live edit locators, pick locators and see actionability logs.
-
+
### Run in debug mode
@@ -56,7 +56,7 @@ dotnet test
You can play, pause or step through each action of your test using the toolbar at the top of the Inspector. You can see the current action highlighted in the test code, and matching elements highlighted in the browser window.
-
+
### Run a test from a specific breakpoint
@@ -68,19 +68,19 @@ await page.PauseAsync();
Once you add a `page.pause()` call, run your tests in debug mode. Clicking the "Resume" button in the Inspector will run the test and only stop on the `page.pause()`.
-
+
### Live editing locators
While running in debug mode you can live edit the locators. Next to the 'Pick Locator' button there is a field showing the [locator](./locators.mdx) that the test is paused on. You can edit this locator directly in the **Pick Locator** field, and matching elements will be highlighted in the browser window.
-
+
### Picking locators
While debugging, you might need to choose a more resilient locator. You can do this by clicking on the **Pick Locator** button and hovering over any element in the browser window. While hovering over an element you will see the code needed to locate this element highlighted below. Clicking an element in the browser will add the locator into the field where you can then either tweak it or copy it into your code.
-
+
Playwright will look at your page and figure out the best locator, prioritizing [role, text and test id locators](./locators.mdx). If Playwright finds multiple elements matching the locator, it will improve the locator to make it resilient and uniquely identify the target element, so you don't have to worry about failing tests due to locators.
@@ -88,7 +88,7 @@ Playwright will look at your page and figure out the best locator, prioritizing
By the time Playwright has paused on a click action, it has already performed [actionability checks](./actionability.mdx) that can be found in the log. This can help you understand what happened during your test and what Playwright did or tried to do. The log tells you if the element was visible, enabled and stable, if the locator resolved to an element, scrolled into view, and so much more. If actionability can't be reached, it will show the action as pending.
-
+
## Trace Viewer
@@ -109,7 +109,7 @@ When running in Debug Mode with `PWDEBUG=console`, a `playwright` object is avai
- **See console logs** during execution (or learn how to [read logs via API](./api/class-page.mdx#page-event-console))
- Check **network activity** and other developer tools features
-
+
To debug your tests using the browser developer tools, start by setting a breakpoint in your test to pause the execution using the [Page.PauseAsync()](/api/class-page.mdx#page-pause) method.
diff --git a/dotnet/docs/emulation.mdx b/dotnet/docs/emulation.mdx
index f302fa7711f..4e99918cb42 100644
--- a/dotnet/docs/emulation.mdx
+++ b/dotnet/docs/emulation.mdx
@@ -27,7 +27,7 @@ var iphone13 = playwright.Devices["iPhone 13"];
await using var context = await browser.NewContextAsync(iphone13);
```
-
+
## Viewport
@@ -78,7 +78,7 @@ await using var context = await browser.NewContextAsync(new()
});
```
-
+
## Permissions
@@ -108,7 +108,7 @@ await using var context = await browser.NewContextAsync(new()
});
```
-
+
Change the location later:
@@ -148,7 +148,7 @@ await page.EmulateMediaAsync(new()
});
```
-
+
## User Agent
diff --git a/dotnet/docs/other-locators.mdx b/dotnet/docs/other-locators.mdx
index 6900288ef1f..b419a658c9c 100644
--- a/dotnet/docs/other-locators.mdx
+++ b/dotnet/docs/other-locators.mdx
@@ -99,7 +99,7 @@ Consider a page with two buttons, first invisible and second visible.
### CSS: elements that contain other elements
-The `:has()` pseudo-class is an [experimental CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:has). It returns an element if any of the selectors passed as parameters relative to the `:scope` of the given element match at least one element.
+The `:has()` pseudo-class is a [CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:has). It returns an element if any of the selectors passed as parameters relative to the `:scope` of the given element match at least one element.
Following snippet returns text content of an `` element that has a `
` inside.
@@ -116,7 +116,7 @@ Comma-separated list of CSS selectors will match all elements that can be select
await page.Locator("button:has-text(\"Log in\"), button:has-text(\"Sign in\")").ClickAsync();
```
-The `:is()` pseudo-class is an [experimental CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:is) that may be useful for specifying a list of extra conditions on an element.
+The `:is()` pseudo-class is a [CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:is) that may be useful for specifying a list of extra conditions on an element.
### CSS: matching elements based on layout
@@ -165,9 +165,19 @@ It is usually possible to distinguish elements by some attribute or text content
Sometimes page contains a number of similar elements, and it is hard to select a particular one. For example:
```html
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
```
In this case, `:nth-match(:text("Buy"), 3)` will select the third button from the snippet above. Note that index is one-based.
diff --git a/dotnet/docs/trace-viewer.mdx b/dotnet/docs/trace-viewer.mdx
index 1943dbbf331..f68133e15f1 100644
--- a/dotnet/docs/trace-viewer.mdx
+++ b/dotnet/docs/trace-viewer.mdx
@@ -26,7 +26,7 @@ pwsh bin/Debug/netX/playwright.ps1 show-trace trace.zip
Trace Viewer loads the trace entirely in your browser and does not transmit any data externally.
-
+
### Viewing remote traces
diff --git a/java/docs/api/class-browsertype.mdx b/java/docs/api/class-browsertype.mdx
index 08bcceedced..832ae422d56 100644
--- a/java/docs/api/class-browsertype.mdx
+++ b/java/docs/api/class-browsertype.mdx
@@ -179,6 +179,9 @@ Browser browser = chromium.launch(new BrowserType.LaunchOptions()
:::
Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/).
+ - `setArtifactsDir` [Path] *(optional)*#
+
+ If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes.
- `setChannel` [String] *(optional)*#
Browser distribution channel.
@@ -292,6 +295,9 @@ BrowserType.launchPersistentContext(userDataDir, options);
:::
Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/).
+ - `setArtifactsDir` [Path] *(optional)*#
+
+ If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes.
- `setBaseURL` [String] *(optional)*#
When using [Page.navigate()](/api/class-page.mdx#page-goto), [Page.route()](/api/class-page.mdx#page-route), [Page.waitForURL()](/api/class-page.mdx#page-wait-for-url), [Page.waitForRequest()](/api/class-page.mdx#page-wait-for-request), or [Page.waitForResponse()](/api/class-page.mdx#page-wait-for-response) it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples:
diff --git a/java/docs/api/class-response.mdx b/java/docs/api/class-response.mdx
index a20dc1b5573..f3d12bb8a31 100644
--- a/java/docs/api/class-response.mdx
+++ b/java/docs/api/class-response.mdx
@@ -183,6 +183,23 @@ Response.headersArray();
---
+### httpVersion {#response-http-version}
+
+Added in: v1.59response.httpVersion
+
+Returns the http version used by the response.
+
+**Usage**
+
+```java
+Response.httpVersion();
+```
+
+**Returns**
+- [String]#
+
+---
+
### ok {#response-ok}
Added before v1.9response.ok
diff --git a/java/docs/browsers.mdx b/java/docs/browsers.mdx
index 972f6e90796..a26bbe2e838 100644
--- a/java/docs/browsers.mdx
+++ b/java/docs/browsers.mdx
@@ -501,7 +501,7 @@ mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="in
-When running Playwright scripts, ask it to search for browsers in a shared location.
+When running Playwright scripts, ask Playwright to search for browsers in a shared location.
+
## Opening the Workflows
diff --git a/java/docs/codegen.mdx b/java/docs/codegen.mdx
index 44269259764..2bf537e5201 100644
--- a/java/docs/codegen.mdx
+++ b/java/docs/codegen.mdx
@@ -67,7 +67,7 @@ mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="co
```
######
-
+
### Emulate devices
@@ -78,7 +78,7 @@ mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args='co
```
######
-
+
### Emulate color scheme
@@ -89,7 +89,7 @@ mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="co
```
######
-
+
### Emulate geolocation, language and timezone
@@ -102,7 +102,7 @@ mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args='co
```
######
-
+
### Preserve authenticated state
@@ -113,13 +113,13 @@ mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="co
```
######
-
+
#### Login
After performing authentication and closing the browser, `auth.json` will contain the storage state which you can then reuse in your tests.
-
+
Make sure you only use the `auth.json` locally as it contains sensitive information. Add it to your `.gitignore` or delete it once you have finished generating your tests.
@@ -132,7 +132,7 @@ mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="co
```
######
-
+
#### Use existing userDataDir
diff --git a/java/docs/debug.mdx b/java/docs/debug.mdx
index 802716ca7cd..a4dcd53c68f 100644
--- a/java/docs/debug.mdx
+++ b/java/docs/debug.mdx
@@ -10,7 +10,7 @@ import HTMLCard from '@site/src/components/HTMLCard';
The Playwright Inspector is a GUI tool to help you debug your Playwright tests. It allows you to step through your tests, live edit locators, pick locators and see actionability logs.
-
+
### Run in debug mode
@@ -65,7 +65,7 @@ mvn test
You can play, pause or step through each action of your test using the toolbar at the top of the Inspector. You can see the current action highlighted in the test code, and matching elements highlighted in the browser window.
-
+
### Run a test from a specific breakpoint
@@ -77,19 +77,19 @@ page.pause();
Once you add a `page.pause()` call, run your tests in debug mode. Clicking the "Resume" button in the Inspector will run the test and only stop on the `page.pause()`.
-
+
### Live editing locators
While running in debug mode you can live edit the locators. Next to the 'Pick Locator' button there is a field showing the [locator](./locators.mdx) that the test is paused on. You can edit this locator directly in the **Pick Locator** field, and matching elements will be highlighted in the browser window.
-
+
### Picking locators
While debugging, you might need to choose a more resilient locator. You can do this by clicking on the **Pick Locator** button and hovering over any element in the browser window. While hovering over an element you will see the code needed to locate this element highlighted below. Clicking an element in the browser will add the locator into the field where you can then either tweak it or copy it into your code.
-
+
Playwright will look at your page and figure out the best locator, prioritizing [role, text and test id locators](./locators.mdx). If Playwright finds multiple elements matching the locator, it will improve the locator to make it resilient and uniquely identify the target element, so you don't have to worry about failing tests due to locators.
@@ -97,7 +97,7 @@ Playwright will look at your page and figure out the best locator, prioritizing
By the time Playwright has paused on a click action, it has already performed [actionability checks](./actionability.mdx) that can be found in the log. This can help you understand what happened during your test and what Playwright did or tried to do. The log tells you if the element was visible, enabled and stable, if the locator resolved to an element, scrolled into view, and so much more. If actionability can't be reached, it will show the action as pending.
-
+
## Trace Viewer
@@ -118,7 +118,7 @@ When running in Debug Mode with `PWDEBUG=console`, a `playwright` object is avai
- **See console logs** during execution (or learn how to [read logs via API](./api/class-page.mdx#page-event-console))
- Check **network activity** and other developer tools features
-
+
To debug your tests using the browser developer tools, start by setting a breakpoint in your test to pause the execution using the [Page.pause()](/api/class-page.mdx#page-pause) method.
diff --git a/java/docs/emulation.mdx b/java/docs/emulation.mdx
index e9ab0fed3f8..d288828a58b 100644
--- a/java/docs/emulation.mdx
+++ b/java/docs/emulation.mdx
@@ -55,7 +55,7 @@ BrowserContext context = browser.newContext(new Browser.NewContextOptions()
.setTimezoneId("Europe/Berlin"));
```
-
+
## Permissions
@@ -89,7 +89,7 @@ BrowserContext context = browser.newContext(new Browser.NewContextOptions()
.setPermissions(Arrays.asList("geolocation")));
```
-
+
Change the location later:
@@ -119,7 +119,7 @@ page.emulateMedia(new Page.EmulateMediaOptions().setColorScheme(ColorScheme.DARK
page.emulateMedia(new Page.EmulateMediaOptions().setMedia(Media.PRINT));
```
-
+
## User Agent
diff --git a/java/docs/other-locators.mdx b/java/docs/other-locators.mdx
index 9fd3729694f..06bc95f1ac3 100644
--- a/java/docs/other-locators.mdx
+++ b/java/docs/other-locators.mdx
@@ -99,7 +99,7 @@ Consider a page with two buttons, first invisible and second visible.
### CSS: elements that contain other elements
-The `:has()` pseudo-class is an [experimental CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:has). It returns an element if any of the selectors passed as parameters relative to the `:scope` of the given element match at least one element.
+The `:has()` pseudo-class is a [CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:has). It returns an element if any of the selectors passed as parameters relative to the `:scope` of the given element match at least one element.
Following snippet returns text content of an `` element that has a `
` inside.
@@ -116,7 +116,7 @@ Comma-separated list of CSS selectors will match all elements that can be select
page.locator("button:has-text(\"Log in\"), button:has-text(\"Sign in\")").click();
```
-The `:is()` pseudo-class is an [experimental CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:is) that may be useful for specifying a list of extra conditions on an element.
+The `:is()` pseudo-class is a [CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:is) that may be useful for specifying a list of extra conditions on an element.
### CSS: matching elements based on layout
@@ -165,9 +165,19 @@ It is usually possible to distinguish elements by some attribute or text content
Sometimes page contains a number of similar elements, and it is hard to select a particular one. For example:
```html
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
```
In this case, `:nth-match(:text("Buy"), 3)` will select the third button from the snippet above. Note that index is one-based.
diff --git a/java/docs/trace-viewer.mdx b/java/docs/trace-viewer.mdx
index ba75839e33e..a142ffcbe4b 100644
--- a/java/docs/trace-viewer.mdx
+++ b/java/docs/trace-viewer.mdx
@@ -26,7 +26,7 @@ mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="sh
Trace Viewer loads the trace entirely in your browser and does not transmit any data externally.
-
+
### Viewing remote traces
diff --git a/nodejs/docs/accessibility-testing.mdx b/nodejs/docs/accessibility-testing.mdx
index 91bb75a3a15..880497c74ca 100644
--- a/nodejs/docs/accessibility-testing.mdx
+++ b/nodejs/docs/accessibility-testing.mdx
@@ -359,6 +359,7 @@ test('example using custom fixture', async ({ page, makeAxeBuilder }) => {
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/actionability.mdx b/nodejs/docs/actionability.mdx
index e7efcafc8b7..0c2264a1b48 100644
--- a/nodejs/docs/actionability.mdx
+++ b/nodejs/docs/actionability.mdx
@@ -149,6 +149,7 @@ For example, consider a scenario where Playwright will click `Sign Up` button re
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api-testing.mdx b/nodejs/docs/api-testing.mdx
index 418d6fa2e45..3c6a341ff87 100644
--- a/nodejs/docs/api-testing.mdx
+++ b/nodejs/docs/api-testing.mdx
@@ -400,6 +400,7 @@ test('global context request has isolated cookie storage', async ({
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-android.mdx b/nodejs/docs/api/class-android.mdx
index 99e61844cf1..75afde52b52 100644
--- a/nodejs/docs/api/class-android.mdx
+++ b/nodejs/docs/api/class-android.mdx
@@ -270,6 +270,7 @@ android.setDefaultTimeout(timeout);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-androiddevice.mdx b/nodejs/docs/api/class-androiddevice.mdx
index aefffad042d..e12031b2d16 100644
--- a/nodejs/docs/api/class-androiddevice.mdx
+++ b/nodejs/docs/api/class-androiddevice.mdx
@@ -966,6 +966,7 @@ androidDevice.on('webview', data => {});
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-androidinput.mdx b/nodejs/docs/api/class-androidinput.mdx
index 0b10491cec6..7e84b18f741 100644
--- a/nodejs/docs/api/class-androidinput.mdx
+++ b/nodejs/docs/api/class-androidinput.mdx
@@ -184,6 +184,7 @@ await androidInput.type(text);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-androidsocket.mdx b/nodejs/docs/api/class-androidsocket.mdx
index 3182aca0e5c..2d7cac68042 100644
--- a/nodejs/docs/api/class-androidsocket.mdx
+++ b/nodejs/docs/api/class-androidsocket.mdx
@@ -111,6 +111,7 @@ androidSocket.on('data', data => {});
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-androidwebview.mdx b/nodejs/docs/api/class-androidwebview.mdx
index d677c49b59d..8235dcaeb33 100644
--- a/nodejs/docs/api/class-androidwebview.mdx
+++ b/nodejs/docs/api/class-androidwebview.mdx
@@ -106,6 +106,7 @@ androidWebView.on('close', data => {});
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-apirequest.mdx b/nodejs/docs/api/class-apirequest.mdx
index 52991fb2e25..427c965320c 100644
--- a/nodejs/docs/api/class-apirequest.mdx
+++ b/nodejs/docs/api/class-apirequest.mdx
@@ -194,6 +194,7 @@ await apiRequest.newContext(options);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-apirequestcontext.mdx b/nodejs/docs/api/class-apirequestcontext.mdx
index c5fb425c6fd..f1eb668a493 100644
--- a/nodejs/docs/api/class-apirequestcontext.mdx
+++ b/nodejs/docs/api/class-apirequestcontext.mdx
@@ -651,6 +651,7 @@ await apiRequestContext.storageState(options);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-apiresponse.mdx b/nodejs/docs/api/class-apiresponse.mdx
index 45392f46675..f276d60fb62 100644
--- a/nodejs/docs/api/class-apiresponse.mdx
+++ b/nodejs/docs/api/class-apiresponse.mdx
@@ -217,6 +217,7 @@ apiResponse.url();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-apiresponseassertions.mdx b/nodejs/docs/api/class-apiresponseassertions.mdx
index edede3d6e03..30955e67d23 100644
--- a/nodejs/docs/api/class-apiresponseassertions.mdx
+++ b/nodejs/docs/api/class-apiresponseassertions.mdx
@@ -87,6 +87,7 @@ await expect(response).not.toBeOK();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-browser.mdx b/nodejs/docs/api/class-browser.mdx
index a03a3443831..780c597b30e 100644
--- a/nodejs/docs/api/class-browser.mdx
+++ b/nodejs/docs/api/class-browser.mdx
@@ -888,6 +888,7 @@ browser.on('disconnected', data => {});
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-browsercontext.mdx b/nodejs/docs/api/class-browsercontext.mdx
index 913fc580e47..22a072d75b6 100644
--- a/nodejs/docs/api/class-browsercontext.mdx
+++ b/nodejs/docs/api/class-browsercontext.mdx
@@ -1420,6 +1420,7 @@ await browserContext.setHTTPCredentials(httpCredentials);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-browserserver.mdx b/nodejs/docs/api/class-browserserver.mdx
index fb1c25d535d..3ec93eefc1e 100644
--- a/nodejs/docs/api/class-browserserver.mdx
+++ b/nodejs/docs/api/class-browserserver.mdx
@@ -125,6 +125,7 @@ browserServer.on('close', data => {});
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-browsertype.mdx b/nodejs/docs/api/class-browsertype.mdx
index 9eac5469b73..6c7eb62022a 100644
--- a/nodejs/docs/api/class-browsertype.mdx
+++ b/nodejs/docs/api/class-browsertype.mdx
@@ -196,6 +196,9 @@ const browser = await chromium.launch({ // Or 'firefox' or 'webkit'.
:::
Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/).
+ - `artifactsDir` [string] *(optional)*#
+
+ If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes.
- `channel` [string] *(optional)*#
Browser distribution channel.
@@ -312,6 +315,9 @@ await browserType.launchPersistentContext(userDataDir, options);
:::
Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/).
+ - `artifactsDir` [string] *(optional)*#
+
+ If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes.
- `baseURL` [string] *(optional)*#
When using [page.goto()](/api/class-page.mdx#page-goto), [page.route()](/api/class-page.mdx#page-route), [page.waitForURL()](/api/class-page.mdx#page-wait-for-url), [page.waitForRequest()](/api/class-page.mdx#page-wait-for-request), or [page.waitForResponse()](/api/class-page.mdx#page-wait-for-response) it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples:
@@ -620,6 +626,9 @@ const { chromium } = require('playwright'); // Or 'webkit' or 'firefox'.
:::
Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/).
+ - `artifactsDir` [string] *(optional)*#
+
+ If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes.
- `channel` [string] *(optional)*#
Browser distribution channel.
@@ -748,6 +757,7 @@ browserType.name();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-cdpsession.mdx b/nodejs/docs/api/class-cdpsession.mdx
index ac77fc98871..70ee900f41b 100644
--- a/nodejs/docs/api/class-cdpsession.mdx
+++ b/nodejs/docs/api/class-cdpsession.mdx
@@ -97,6 +97,7 @@ await cdpSession.send(method, params);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-clock.mdx b/nodejs/docs/api/class-clock.mdx
index 27c66d833b7..9d6499a517d 100644
--- a/nodejs/docs/api/class-clock.mdx
+++ b/nodejs/docs/api/class-clock.mdx
@@ -225,6 +225,7 @@ await page.clock.setSystemTime('2020-02-02');
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-consolemessage.mdx b/nodejs/docs/api/class-consolemessage.mdx
index 68b4bbe0957..ec746ce9365 100644
--- a/nodejs/docs/api/class-consolemessage.mdx
+++ b/nodejs/docs/api/class-consolemessage.mdx
@@ -185,6 +185,7 @@ consoleMessage.worker();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-coverage.mdx b/nodejs/docs/api/class-coverage.mdx
index bc6fdd8b770..fb113634305 100644
--- a/nodejs/docs/api/class-coverage.mdx
+++ b/nodejs/docs/api/class-coverage.mdx
@@ -209,6 +209,7 @@ await coverage.stopJSCoverage();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-dialog.mdx b/nodejs/docs/api/class-dialog.mdx
index c95d475aa2e..c9b98ca6217 100644
--- a/nodejs/docs/api/class-dialog.mdx
+++ b/nodejs/docs/api/class-dialog.mdx
@@ -168,6 +168,7 @@ dialog.type();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-download.mdx b/nodejs/docs/api/class-download.mdx
index 09f0dab64bb..de550ef4daa 100644
--- a/nodejs/docs/api/class-download.mdx
+++ b/nodejs/docs/api/class-download.mdx
@@ -218,6 +218,7 @@ download.url();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-electron.mdx b/nodejs/docs/api/class-electron.mdx
index f2e34a344a7..6965f0abe2d 100644
--- a/nodejs/docs/api/class-electron.mdx
+++ b/nodejs/docs/api/class-electron.mdx
@@ -209,6 +209,7 @@ await electron.launch(options);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-electronapplication.mdx b/nodejs/docs/api/class-electronapplication.mdx
index f7cc04660e7..a5899c8813f 100644
--- a/nodejs/docs/api/class-electronapplication.mdx
+++ b/nodejs/docs/api/class-electronapplication.mdx
@@ -337,6 +337,7 @@ electronApplication.on('window', data => {});
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-elementhandle.mdx b/nodejs/docs/api/class-elementhandle.mdx
index 2b52cf7a52c..036a82f64c9 100644
--- a/nodejs/docs/api/class-elementhandle.mdx
+++ b/nodejs/docs/api/class-elementhandle.mdx
@@ -1618,6 +1618,7 @@ This method does not work across navigations, use [page.waitForSelector()](/api/
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-filechooser.mdx b/nodejs/docs/api/class-filechooser.mdx
index dad48b1c4b0..6ae461b7ba1 100644
--- a/nodejs/docs/api/class-filechooser.mdx
+++ b/nodejs/docs/api/class-filechooser.mdx
@@ -140,6 +140,7 @@ await fileChooser.setFiles(files, options);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-fixtures.mdx b/nodejs/docs/api/class-fixtures.mdx
index c8bdf3266de..85599c40aaf 100644
--- a/nodejs/docs/api/class-fixtures.mdx
+++ b/nodejs/docs/api/class-fixtures.mdx
@@ -188,6 +188,7 @@ test('basic test', async ({ request }) => {
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-frame.mdx b/nodejs/docs/api/class-frame.mdx
index 5a4cfc20c10..a2a4c2871d2 100644
--- a/nodejs/docs/api/class-frame.mdx
+++ b/nodejs/docs/api/class-frame.mdx
@@ -2680,6 +2680,7 @@ await frame.waitForTimeout(timeout);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-framelocator.mdx b/nodejs/docs/api/class-framelocator.mdx
index dd879737020..275b69fcd61 100644
--- a/nodejs/docs/api/class-framelocator.mdx
+++ b/nodejs/docs/api/class-framelocator.mdx
@@ -562,6 +562,7 @@ frameLocator.nth(index);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-fullconfig.mdx b/nodejs/docs/api/class-fullconfig.mdx
index 6158aa3a16c..ed88c610386 100644
--- a/nodejs/docs/api/class-fullconfig.mdx
+++ b/nodejs/docs/api/class-fullconfig.mdx
@@ -468,6 +468,7 @@ fullConfig.workers
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-fullproject.mdx b/nodejs/docs/api/class-fullproject.mdx
index 36e220a4c82..51a2d6762c1 100644
--- a/nodejs/docs/api/class-fullproject.mdx
+++ b/nodejs/docs/api/class-fullproject.mdx
@@ -311,6 +311,7 @@ fullProject.use
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-genericassertions.mdx b/nodejs/docs/api/class-genericassertions.mdx
index b85af067bf1..cae867c786c 100644
--- a/nodejs/docs/api/class-genericassertions.mdx
+++ b/nodejs/docs/api/class-genericassertions.mdx
@@ -809,6 +809,7 @@ expect(value).not.toBe(2);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-inspector.mdx b/nodejs/docs/api/class-inspector.mdx
new file mode 100644
index 00000000000..04167921fba
--- /dev/null
+++ b/nodejs/docs/api/class-inspector.mdx
@@ -0,0 +1,245 @@
+---
+id: class-inspector
+title: "Inspector"
+---
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+import HTMLCard from '@site/src/components/HTMLCard';
+
+
+Interface to the Playwright inspector.
+
+
+---
+
+## Methods
+
+### cancelPickLocator {#inspector-cancel-pick-locator}
+
+Added in: v1.59inspector.cancelPickLocator
+
+Cancels an ongoing [inspector.pickLocator()](/api/class-inspector.mdx#inspector-pick-locator) call by deactivating pick locator mode. If no pick locator mode is active, this method is a no-op.
+
+**Usage**
+
+```js
+await inspector.cancelPickLocator();
+```
+
+**Returns**
+- [Promise]<[void]>#
+
+---
+
+### pickLocator {#inspector-pick-locator}
+
+Added in: v1.59inspector.pickLocator
+
+Enters pick locator mode where hovering over page elements highlights them and shows the corresponding locator. Once the user clicks an element, the mode is deactivated and the [Locator] for the picked element is returned.
+
+**Usage**
+
+```js
+const locator = await page.inspector().pickLocator();
+console.log(locator);
+```
+
+**Returns**
+- [Promise]<[Locator]>#
+
+---
+
+### startScreencast {#inspector-start-screencast}
+
+Added in: v1.59inspector.startScreencast
+
+Starts capturing screencast frames. Frames are emitted as [inspector.on('screencastframe')](/api/class-inspector.mdx#inspector-event-screencast-frame) events.
+
+**Usage**
+
+```js
+const inspector = page.inspector();
+inspector.on('screencastframe', ({ data, width, height }) => {
+ console.log(`frame ${width}x${height}, size: ${data.length}`);
+});
+await inspector.startScreencast({ size: { width: 800, height: 600 } });
+// ... perform actions ...
+await inspector.stopScreencast();
+```
+
+**Arguments**
+- `options` [Object] *(optional)*
+ - `size` [Object] *(optional)*#
+ - `width` [number]
+
+ Frame width in pixels.
+ - `height` [number]
+
+ Frame height in pixels.
+
+ Optional dimensions for the screencast frames. If not specified, the current page viewport size is used.
+
+**Returns**
+- [Promise]<[void]>#
+
+---
+
+### stopScreencast {#inspector-stop-screencast}
+
+Added in: v1.59inspector.stopScreencast
+
+Stops the screencast started with [inspector.startScreencast()](/api/class-inspector.mdx#inspector-start-screencast).
+
+**Usage**
+
+```js
+await inspector.startScreencast();
+// ... perform actions ...
+await inspector.stopScreencast();
+```
+
+**Returns**
+- [Promise]<[void]>#
+
+---
+
+## Events
+
+### on('screencastframe') {#inspector-event-screencast-frame}
+
+Added in: v1.59inspector.on('screencastframe')
+
+Emitted for each captured JPEG screencast frame while the screencast is running.
+
+**Usage**
+
+```js
+const inspector = page.inspector();
+inspector.on('screencastframe', ({ data, width, height }) => {
+ console.log(`frame ${width}x${height}, jpeg size: ${data.length}`);
+ require('fs').writeFileSync('frame.jpg', data);
+});
+await inspector.startScreencast({ size: { width: 1280, height: 720 } });
+// ... perform actions ...
+await inspector.stopScreencast();
+```
+
+**Event data**
+- [Object]
+ - `data` [Buffer]
+
+ JPEG-encoded frame data.
+ - `width` [number]
+
+ Frame width in pixels.
+ - `height` [number]
+
+ Frame height in pixels.
+
+
+[Android]: /api/class-android.mdx "Android"
+[AndroidDevice]: /api/class-androiddevice.mdx "AndroidDevice"
+[AndroidInput]: /api/class-androidinput.mdx "AndroidInput"
+[AndroidSocket]: /api/class-androidsocket.mdx "AndroidSocket"
+[AndroidWebView]: /api/class-androidwebview.mdx "AndroidWebView"
+[APIRequest]: /api/class-apirequest.mdx "APIRequest"
+[APIRequestContext]: /api/class-apirequestcontext.mdx "APIRequestContext"
+[APIResponse]: /api/class-apiresponse.mdx "APIResponse"
+[APIResponseAssertions]: /api/class-apiresponseassertions.mdx "APIResponseAssertions"
+[Browser]: /api/class-browser.mdx "Browser"
+[BrowserContext]: /api/class-browsercontext.mdx "BrowserContext"
+[BrowserServer]: /api/class-browserserver.mdx "BrowserServer"
+[BrowserType]: /api/class-browsertype.mdx "BrowserType"
+[CDPSession]: /api/class-cdpsession.mdx "CDPSession"
+[Clock]: /api/class-clock.mdx "Clock"
+[ConsoleMessage]: /api/class-consolemessage.mdx "ConsoleMessage"
+[Coverage]: /api/class-coverage.mdx "Coverage"
+[Dialog]: /api/class-dialog.mdx "Dialog"
+[Download]: /api/class-download.mdx "Download"
+[Electron]: /api/class-electron.mdx "Electron"
+[ElectronApplication]: /api/class-electronapplication.mdx "ElectronApplication"
+[ElementHandle]: /api/class-elementhandle.mdx "ElementHandle"
+[FileChooser]: /api/class-filechooser.mdx "FileChooser"
+[Frame]: /api/class-frame.mdx "Frame"
+[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
+[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
+[JSHandle]: /api/class-jshandle.mdx "JSHandle"
+[Keyboard]: /api/class-keyboard.mdx "Keyboard"
+[Locator]: /api/class-locator.mdx "Locator"
+[LocatorAssertions]: /api/class-locatorassertions.mdx "LocatorAssertions"
+[Logger]: /api/class-logger.mdx "Logger"
+[Mouse]: /api/class-mouse.mdx "Mouse"
+[Page]: /api/class-page.mdx "Page"
+[PageAgent]: /api/class-pageagent.mdx "PageAgent"
+[PageAssertions]: /api/class-pageassertions.mdx "PageAssertions"
+[Playwright]: /api/class-playwright.mdx "Playwright"
+[PlaywrightAssertions]: /api/class-playwrightassertions.mdx "PlaywrightAssertions"
+[Request]: /api/class-request.mdx "Request"
+[Response]: /api/class-response.mdx "Response"
+[Route]: /api/class-route.mdx "Route"
+[Selectors]: /api/class-selectors.mdx "Selectors"
+[SnapshotAssertions]: /api/class-snapshotassertions.mdx "SnapshotAssertions"
+[TimeoutError]: /api/class-timeouterror.mdx "TimeoutError"
+[Touchscreen]: /api/class-touchscreen.mdx "Touchscreen"
+[Tracing]: /api/class-tracing.mdx "Tracing"
+[Video]: /api/class-video.mdx "Video"
+[WebError]: /api/class-weberror.mdx "WebError"
+[WebSocket]: /api/class-websocket.mdx "WebSocket"
+[WebSocketRoute]: /api/class-websocketroute.mdx "WebSocketRoute"
+[Worker]: /api/class-worker.mdx "Worker"
+[Fixtures]: /api/class-fixtures.mdx "Fixtures"
+[FullConfig]: /api/class-fullconfig.mdx "FullConfig"
+[FullProject]: /api/class-fullproject.mdx "FullProject"
+[Location]: /api/class-location.mdx "Location"
+[Test]: /api/class-test.mdx "Test"
+[TestConfig]: /api/class-testconfig.mdx "TestConfig"
+[TestInfo]: /api/class-testinfo.mdx "TestInfo"
+[TestInfoError]: /api/class-testinfoerror.mdx "TestInfoError"
+[TestOptions]: /api/class-testoptions.mdx "TestOptions"
+[TestProject]: /api/class-testproject.mdx "TestProject"
+[TestStepInfo]: /api/class-teststepinfo.mdx "TestStepInfo"
+[WorkerInfo]: /api/class-workerinfo.mdx "WorkerInfo"
+[Reporter]: /api/class-reporter.mdx "Reporter"
+[Suite]: /api/class-suite.mdx "Suite"
+[TestCase]: /api/class-testcase.mdx "TestCase"
+[TestError]: /api/class-testerror.mdx "TestError"
+[TestResult]: /api/class-testresult.mdx "TestResult"
+[TestStep]: /api/class-teststep.mdx "TestStep"
+[Element]: https://developer.mozilla.org/en-US/docs/Web/API/element "Element"
+[EvaluationArgument]: /evaluating.mdx#evaluation-argument "EvaluationArgument"
+[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise"
+[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols "Iterator"
+[origin]: https://developer.mozilla.org/en-US/docs/Glossary/Origin "Origin"
+[selector]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors "selector"
+[Serializable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description "Serializable"
+[UIEvent.detail]: https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail "UIEvent.detail"
+[UnixTime]: https://en.wikipedia.org/wiki/Unix_time "Unix Time"
+[xpath]: https://developer.mozilla.org/en-US/docs/Web/XPath "xpath"
+
+[Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array "Array"
+[boolean]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type "Boolean"
+[Buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer "Buffer"
+[ChildProcess]: https://nodejs.org/api/child_process.html "ChildProcess"
+[Date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date "Date"
+[Error]: https://nodejs.org/api/errors.html#errors_class_error "Error"
+[EventEmitter]: https://nodejs.org/api/events.html#events_class_eventemitter "EventEmitter"
+[function]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function "Function"
+[FormData]: https://developer.mozilla.org/en-US/docs/Web/API/FormData "FormData"
+[Map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map "Map"
+[Metadata]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object<string, any>"
+[null]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null "null"
+[number]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type "Number"
+[Object]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object "Object"
+[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise "Promise"
+[Readable]: https://nodejs.org/api/stream.html#stream_class_stream_readable "Readable"
+[ReadStream]: https://nodejs.org/api/fs.html#class-fsreadstream "ReadStream"
+[RegExp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp "RegExp"
+[string]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type "string"
+[void]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined "void"
+[URL]: https://nodejs.org/api/url.html "URL"
+[URLSearchParams]: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams "URLSearchParams"
+
+[all available image tags]: https://mcr.microsoft.com/en-us/product/playwright/about "all available image tags"
+[Microsoft Artifact Registry]: https://mcr.microsoft.com/en-us/product/playwright/about "Microsoft Artifact Registry"
+[Dockerfile.noble]: https://github.com/microsoft/playwright/blob/main/utils/docker/Dockerfile.noble "Dockerfile.noble"
diff --git a/nodejs/docs/api/class-jshandle.mdx b/nodejs/docs/api/class-jshandle.mdx
index e817bfb25f7..8f9ea2a9e43 100644
--- a/nodejs/docs/api/class-jshandle.mdx
+++ b/nodejs/docs/api/class-jshandle.mdx
@@ -211,6 +211,7 @@ await jsHandle.jsonValue();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-keyboard.mdx b/nodejs/docs/api/class-keyboard.mdx
index a9192965836..b3173f1d937 100644
--- a/nodejs/docs/api/class-keyboard.mdx
+++ b/nodejs/docs/api/class-keyboard.mdx
@@ -252,6 +252,7 @@ await keyboard.up(key);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-location.mdx b/nodejs/docs/api/class-location.mdx
index 056ec87d32c..89996791156 100644
--- a/nodejs/docs/api/class-location.mdx
+++ b/nodejs/docs/api/class-location.mdx
@@ -90,6 +90,7 @@ location.line
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-locator.mdx b/nodejs/docs/api/class-locator.mdx
index f97c96208b8..1841657cfd9 100644
--- a/nodejs/docs/api/class-locator.mdx
+++ b/nodejs/docs/api/class-locator.mdx
@@ -2562,6 +2562,7 @@ To press a special key, like `Control` or `ArrowDown`, use [locator.press()](/ap
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-locatorassertions.mdx b/nodejs/docs/api/class-locatorassertions.mdx
index 21f76f7c977..ccb360b31b9 100644
--- a/nodejs/docs/api/class-locatorassertions.mdx
+++ b/nodejs/docs/api/class-locatorassertions.mdx
@@ -1144,6 +1144,7 @@ await expect(locator).not.toContainText('error');
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-logger.mdx b/nodejs/docs/api/class-logger.mdx
index 8f6470e1abe..0f1914dbe60 100644
--- a/nodejs/docs/api/class-logger.mdx
+++ b/nodejs/docs/api/class-logger.mdx
@@ -111,6 +111,7 @@ logger.log(name, severity, message, args, hints);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-mouse.mdx b/nodejs/docs/api/class-mouse.mdx
index 43eebd33ce9..54b9cfbda16 100644
--- a/nodejs/docs/api/class-mouse.mdx
+++ b/nodejs/docs/api/class-mouse.mdx
@@ -240,6 +240,7 @@ await mouse.wheel(deltaX, deltaY);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-page.mdx b/nodejs/docs/api/class-page.mdx
index df83ff21f79..72f97435a85 100644
--- a/nodejs/docs/api/class-page.mdx
+++ b/nodejs/docs/api/class-page.mdx
@@ -1327,6 +1327,29 @@ await page.goto(url, options);
---
+### inspector {#page-inspector}
+
+Added in: v1.59page.inspector
+
+Returns the [Inspector] object associated with this page.
+
+**Usage**
+
+```js
+const inspector = page.inspector();
+inspector.on('screencastFrame', data => {
+ console.log('received frame, jpeg size:', data.length);
+});
+await inspector.startScreencast();
+// ... perform actions ...
+await inspector.stopScreencast();
+```
+
+**Returns**
+- [Inspector]#
+
+---
+
### isClosed {#page-is-closed}
Added before v1.9page.isClosed
@@ -4624,6 +4647,7 @@ await page.waitForTimeout(1000);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-pageagent.mdx b/nodejs/docs/api/class-pageagent.mdx
index e53b521f2f7..1e466a0f0db 100644
--- a/nodejs/docs/api/class-pageagent.mdx
+++ b/nodejs/docs/api/class-pageagent.mdx
@@ -254,6 +254,7 @@ pageAgent.on('turn', data => {});
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-pageassertions.mdx b/nodejs/docs/api/class-pageassertions.mdx
index a9b23b221a1..1ce63935277 100644
--- a/nodejs/docs/api/class-pageassertions.mdx
+++ b/nodejs/docs/api/class-pageassertions.mdx
@@ -300,6 +300,7 @@ await expect(page).not.toHaveURL('error');
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-playwright.mdx b/nodejs/docs/api/class-playwright.mdx
index b6d40a41f05..79e1f0e2168 100644
--- a/nodejs/docs/api/class-playwright.mdx
+++ b/nodejs/docs/api/class-playwright.mdx
@@ -203,6 +203,7 @@ playwright.webkit
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-playwrightassertions.mdx b/nodejs/docs/api/class-playwrightassertions.mdx
index 132a3987a79..220d1721857 100644
--- a/nodejs/docs/api/class-playwrightassertions.mdx
+++ b/nodejs/docs/api/class-playwrightassertions.mdx
@@ -131,6 +131,7 @@ Creates a [PageAssertions] object for the given [Page].
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-reporter.mdx b/nodejs/docs/api/class-reporter.mdx
index 6e148974789..885a9f96a5f 100644
--- a/nodejs/docs/api/class-reporter.mdx
+++ b/nodejs/docs/api/class-reporter.mdx
@@ -402,6 +402,7 @@ reporter.printsToStdio();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-request.mdx b/nodejs/docs/api/class-request.mdx
index c238e30c909..3d4ae98a132 100644
--- a/nodejs/docs/api/class-request.mdx
+++ b/nodejs/docs/api/class-request.mdx
@@ -494,6 +494,7 @@ request.url();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-response.mdx b/nodejs/docs/api/class-response.mdx
index fd0541d4c90..faecd51f31c 100644
--- a/nodejs/docs/api/class-response.mdx
+++ b/nodejs/docs/api/class-response.mdx
@@ -183,6 +183,23 @@ await response.headersArray();
---
+### httpVersion {#response-http-version}
+
+Added in: v1.59response.httpVersion
+
+Returns the http version used by the response.
+
+**Usage**
+
+```js
+await response.httpVersion();
+```
+
+**Returns**
+- [Promise]<[string]>#
+
+---
+
### json {#response-json}
Added before v1.9response.json
@@ -383,6 +400,7 @@ response.url();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-route.mdx b/nodejs/docs/api/class-route.mdx
index d8504bb3723..0ab0c5dda69 100644
--- a/nodejs/docs/api/class-route.mdx
+++ b/nodejs/docs/api/class-route.mdx
@@ -338,6 +338,7 @@ route.request();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-selectors.mdx b/nodejs/docs/api/class-selectors.mdx
index 87f2533c851..f06914470b6 100644
--- a/nodejs/docs/api/class-selectors.mdx
+++ b/nodejs/docs/api/class-selectors.mdx
@@ -126,6 +126,7 @@ selectors.setTestIdAttribute(attributeName);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-snapshotassertions.mdx b/nodejs/docs/api/class-snapshotassertions.mdx
index a0923964ed3..3e5dbe48954 100644
--- a/nodejs/docs/api/class-snapshotassertions.mdx
+++ b/nodejs/docs/api/class-snapshotassertions.mdx
@@ -144,6 +144,7 @@ Note that matching snapshots only work with Playwright test runner.
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-suite.mdx b/nodejs/docs/api/class-suite.mdx
index 25c38d1fcc4..3714533658c 100644
--- a/nodejs/docs/api/class-suite.mdx
+++ b/nodejs/docs/api/class-suite.mdx
@@ -230,6 +230,7 @@ suite.type
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-test.mdx b/nodejs/docs/api/class-test.mdx
index be374520a1a..a71db96f4ba 100644
--- a/nodejs/docs/api/class-test.mdx
+++ b/nodejs/docs/api/class-test.mdx
@@ -1903,6 +1903,7 @@ test.describe.serial.only(() => {
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-testcase.mdx b/nodejs/docs/api/class-testcase.mdx
index bf283dd6c08..9ead7ea7b6c 100644
--- a/nodejs/docs/api/class-testcase.mdx
+++ b/nodejs/docs/api/class-testcase.mdx
@@ -316,6 +316,7 @@ testCase.type
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-testconfig.mdx b/nodejs/docs/api/class-testconfig.mdx
index 28d39a0bad8..3632455624c 100644
--- a/nodejs/docs/api/class-testconfig.mdx
+++ b/nodejs/docs/api/class-testconfig.mdx
@@ -1269,6 +1269,7 @@ This path will serve as the base directory for each test file snapshot directory
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-testerror.mdx b/nodejs/docs/api/class-testerror.mdx
index dca6dd37935..8e1998b7897 100644
--- a/nodejs/docs/api/class-testerror.mdx
+++ b/nodejs/docs/api/class-testerror.mdx
@@ -141,6 +141,7 @@ testError.value
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-testinfo.mdx b/nodejs/docs/api/class-testinfo.mdx
index 7826b9f9b29..4fe31c09e96 100644
--- a/nodejs/docs/api/class-testinfo.mdx
+++ b/nodejs/docs/api/class-testinfo.mdx
@@ -887,6 +887,7 @@ testInfo.workerIndex
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-testinfoerror.mdx b/nodejs/docs/api/class-testinfoerror.mdx
index a1ea68ee1dd..3eaf0a82da1 100644
--- a/nodejs/docs/api/class-testinfoerror.mdx
+++ b/nodejs/docs/api/class-testinfoerror.mdx
@@ -107,6 +107,7 @@ testInfoError.value
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-testoptions.mdx b/nodejs/docs/api/class-testoptions.mdx
index 9a34db62425..2b10d2f7e88 100644
--- a/nodejs/docs/api/class-testoptions.mdx
+++ b/nodejs/docs/api/class-testoptions.mdx
@@ -1001,6 +1001,7 @@ Whether to record trace for each test. Defaults to `'off'`.
* `'on-all-retries'`: Record trace only when retrying a test.
* `'retain-on-failure'`: Record trace for each test. When test run passes, remove the recorded trace.
* `'retain-on-first-failure'`: Record trace for the first run of each test, but not for retries. When test run passes, remove the recorded trace.
+* `'retain-on-failure-and-retries'`: Record trace for each test run. Retains all traces when an attempt fails.
For more control, pass an object that specifies `mode` and trace features to enable.
@@ -1019,8 +1020,8 @@ export default defineConfig({
Learn more about [recording trace](../test-use-options.mdx#recording-options).
**Type**
-- [Object] | "off" | "on" | "retain-on-failure" | "on-first-retry" | "retain-on-first-failure"
- - `mode` "off" | "on" | "retain-on-failure" | "on-first-retry" | "on-all-retries" | "retain-on-first-failure"
+- [Object] | "off" | "on" | "retain-on-failure" | "on-first-retry" | "retain-on-first-failure" | "retain-on-failure-and-retries"
+ - `mode` "off" | "on" | "retain-on-failure" | "on-first-retry" | "on-all-retries" | "retain-on-first-failure" | "retain-on-failure-and-retries"
Trace recording mode.
- `attachments` [boolean] *(optional)*
@@ -1162,6 +1163,7 @@ export default defineConfig({
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-testproject.mdx b/nodejs/docs/api/class-testproject.mdx
index d8105f1fa6c..8de36438487 100644
--- a/nodejs/docs/api/class-testproject.mdx
+++ b/nodejs/docs/api/class-testproject.mdx
@@ -791,6 +791,7 @@ export default defineConfig({
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-testresult.mdx b/nodejs/docs/api/class-testresult.mdx
index 52d91723996..6b30ffababf 100644
--- a/nodejs/docs/api/class-testresult.mdx
+++ b/nodejs/docs/api/class-testresult.mdx
@@ -292,6 +292,7 @@ testResult.workerIndex
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-teststep.mdx b/nodejs/docs/api/class-teststep.mdx
index b21cf96b038..8161ebdf0c7 100644
--- a/nodejs/docs/api/class-teststep.mdx
+++ b/nodejs/docs/api/class-teststep.mdx
@@ -255,6 +255,7 @@ testStep.title
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-teststepinfo.mdx b/nodejs/docs/api/class-teststepinfo.mdx
index c2850787f39..4c7395a2238 100644
--- a/nodejs/docs/api/class-teststepinfo.mdx
+++ b/nodejs/docs/api/class-teststepinfo.mdx
@@ -186,6 +186,7 @@ testStepInfo.titlePath
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-timeouterror.mdx b/nodejs/docs/api/class-timeouterror.mdx
index 859990d6432..5e6a6ff7a08 100644
--- a/nodejs/docs/api/class-timeouterror.mdx
+++ b/nodejs/docs/api/class-timeouterror.mdx
@@ -57,6 +57,7 @@ const playwright = require('playwright');
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-touchscreen.mdx b/nodejs/docs/api/class-touchscreen.mdx
index b934a497f4c..b8b2ade32aa 100644
--- a/nodejs/docs/api/class-touchscreen.mdx
+++ b/nodejs/docs/api/class-touchscreen.mdx
@@ -71,6 +71,7 @@ await touchscreen.tap(x, y);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-tracing.mdx b/nodejs/docs/api/class-tracing.mdx
index 3b01b70c5e6..7574ab6249c 100644
--- a/nodejs/docs/api/class-tracing.mdx
+++ b/nodejs/docs/api/class-tracing.mdx
@@ -251,6 +251,7 @@ await tracing.stopChunk(options);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-video.mdx b/nodejs/docs/api/class-video.mdx
index ecade42bdfd..413604b8803 100644
--- a/nodejs/docs/api/class-video.mdx
+++ b/nodejs/docs/api/class-video.mdx
@@ -162,6 +162,7 @@ await video.stop(options);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-weberror.mdx b/nodejs/docs/api/class-weberror.mdx
index 3617849b305..449ef29cd21 100644
--- a/nodejs/docs/api/class-weberror.mdx
+++ b/nodejs/docs/api/class-weberror.mdx
@@ -83,6 +83,7 @@ webError.page();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-websocket.mdx b/nodejs/docs/api/class-websocket.mdx
index 3d3819042cc..521b1d705ee 100644
--- a/nodejs/docs/api/class-websocket.mdx
+++ b/nodejs/docs/api/class-websocket.mdx
@@ -187,6 +187,7 @@ webSocket.on('socketerror', data => {});
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-websocketroute.mdx b/nodejs/docs/api/class-websocketroute.mdx
index 11859eec834..240ce3e35b7 100644
--- a/nodejs/docs/api/class-websocketroute.mdx
+++ b/nodejs/docs/api/class-websocketroute.mdx
@@ -238,6 +238,7 @@ webSocketRoute.url();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-worker.mdx b/nodejs/docs/api/class-worker.mdx
index fd60d5888b1..5e305b30177 100644
--- a/nodejs/docs/api/class-worker.mdx
+++ b/nodejs/docs/api/class-worker.mdx
@@ -199,6 +199,7 @@ worker.on('console', data => {});
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/api/class-workerinfo.mdx b/nodejs/docs/api/class-workerinfo.mdx
index 3eb8e0722b2..c8a24172889 100644
--- a/nodejs/docs/api/class-workerinfo.mdx
+++ b/nodejs/docs/api/class-workerinfo.mdx
@@ -111,6 +111,7 @@ workerInfo.workerIndex
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/aria-snapshots.mdx b/nodejs/docs/aria-snapshots.mdx
index 565b975be0a..390fbd11e58 100644
--- a/nodejs/docs/aria-snapshots.mdx
+++ b/nodejs/docs/aria-snapshots.mdx
@@ -446,6 +446,7 @@ Commonly used ARIA attributes, like `checked`, `disabled`, `expanded`, `level`,
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/auth.mdx b/nodejs/docs/auth.mdx
index 3f7a142988c..df637047a78 100644
--- a/nodejs/docs/auth.mdx
+++ b/nodejs/docs/auth.mdx
@@ -553,6 +553,7 @@ test('not signed in test', async ({ page }) => {
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/best-practices.mdx b/nodejs/docs/best-practices.mdx
index 1b8e4e20c9e..4b671710f5f 100644
--- a/nodejs/docs/best-practices.mdx
+++ b/nodejs/docs/best-practices.mdx
@@ -147,13 +147,13 @@ This will open a new browser window as well as the Playwright inspector. To pick
You can then hover over any element on your page in the browser window and see the locator highlighted below your cursor. Clicking on an element will add the locator into the Playwright inspector. You can either copy the locator and paste into your test file or continue to explore the locator by editing it in the Playwright Inspector, for example by modifying the text, and seeing the results in the browser window.
-
+
#### Use the VS Code extension to generate locators
You can also use the [VS Code Extension](./getting-started-vscode.mdx) to generate locators as well as record a test. The VS Code extension also gives you a great developer experience when writing, running, and debugging tests.
-
+
### Use web first assertions
@@ -189,11 +189,11 @@ await expect(page.getByText('welcome')).toBeVisible();
For local debugging we recommend you [debug your tests live in VSCode.](./getting-started-vscode.mdx#debugging-your-tests) by installing the [VS Code extension](./getting-started-vscode.mdx). You can run tests in debug mode by right-clicking on the line next to the test you want to run which will open a browser window and pause at where the breakpoint is set.
-
+
You can live debug your test by clicking or editing the locators in your test in VS Code which will highlight this locator in the browser window as well as show you any other matching locators found on the page.
-
+
You can also debug your tests with the Playwright inspector by running your tests with the `--debug` flag.
@@ -227,7 +227,7 @@ pnpm exec playwright test --debug
You can then step through your test, view actionability logs and edit the locator live and see it highlighted in the browser window. This will show you which locators match, how many of them there are.
-
+
To debug a specific test add the name of the test file and the line number of the test followed by the `--debug` flag.
@@ -263,7 +263,7 @@ pnpm exec playwright test example.spec.ts:9 --debug
For CI failures, use the Playwright [trace viewer](./trace-viewer.mdx) instead of videos and screenshots. The trace viewer gives you a full trace of your tests as a local Progressive Web App (PWA) that can easily be shared. With the trace viewer you can view the timeline, inspect DOM snapshots for each action using dev tools, view network requests and more.
-
+
Traces are configured in the Playwright config file and are set to run on CI on the first retry of a failed test. We don't recommend setting this to `on` so that traces are run on every test as it's very performance heavy. However you can run a trace locally when developing with the `--trace` flag.
@@ -325,11 +325,11 @@ pnpm exec playwright show-report
-
+
Traces can be opened by clicking on the icon next to the test file name or by opening each of the test reports and scrolling down to the traces section.
-
+
### Use Playwright's Tooling
@@ -537,6 +537,7 @@ await page.getByRole('link', { name: 'next page' }).click();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/browser-contexts.mdx b/nodejs/docs/browser-contexts.mdx
index ce36f4c4ee9..370404ccd2a 100644
--- a/nodejs/docs/browser-contexts.mdx
+++ b/nodejs/docs/browser-contexts.mdx
@@ -141,6 +141,7 @@ const userPage = await userContext.newPage();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/browsers.mdx b/nodejs/docs/browsers.mdx
index 6f5716ebace..f5ea4c6c97c 100644
--- a/nodejs/docs/browsers.mdx
+++ b/nodejs/docs/browsers.mdx
@@ -521,7 +521,7 @@ npx playwright install
-When running Playwright scripts, ask it to search for browsers in a shared location.
+When running Playwright scripts, ask Playwright to search for browsers in a shared location.
{
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/ci-intro.mdx b/nodejs/docs/ci-intro.mdx
index 1af43e65283..97ef64f0be5 100644
--- a/nodejs/docs/ci-intro.mdx
+++ b/nodejs/docs/ci-intro.mdx
@@ -66,7 +66,7 @@ To learn more about this, see ["Understanding GitHub Actions"](https://docs.gith
Once you have your [GitHub Actions workflow](#setting-up-github-actions) setup, then all you need to do is [Create a repo on GitHub](https://docs.github.com/en/get-started/quickstart/create-a-repo) or push your code to an existing repository. Follow the instructions on GitHub and don't forget to [initialize a git repository](https://github.com/git-guides/git-init) using the `git init` command so you can [add](https://github.com/git-guides/git-add), [commit](https://github.com/git-guides/git-commit), and [push](https://github.com/git-guides/git-push) your code.
######
-
+
## Opening the Workflows
@@ -90,7 +90,7 @@ The HTML Report shows you a full report of your tests. You can filter the report
In the Artifacts section, click on the **playwright-report** to download your report in the format of a zip file.
-
+
### Viewing the HTML Report
@@ -190,6 +190,7 @@ Artifacts like trace files, HTML reports or even the console logs contain inform
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/ci.mdx b/nodejs/docs/ci.mdx
index 65817107170..3149cec32ca 100644
--- a/nodejs/docs/ci.mdx
+++ b/nodejs/docs/ci.mdx
@@ -532,6 +532,7 @@ xvfb-run npx playwright test
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/clock.mdx b/nodejs/docs/clock.mdx
index 2ae40cf9790..1afed2c1524 100644
--- a/nodejs/docs/clock.mdx
+++ b/nodejs/docs/clock.mdx
@@ -203,6 +203,7 @@ await expect(page.getByTestId('current-time')).toHaveText('2/2/2024, 10:00:02 AM
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/codegen-intro.mdx b/nodejs/docs/codegen-intro.mdx
index a97b28d0baa..47aa0b04b6d 100644
--- a/nodejs/docs/codegen-intro.mdx
+++ b/nodejs/docs/codegen-intro.mdx
@@ -89,6 +89,7 @@ You can generate tests using emulation for specific viewports, devices, color sc
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/codegen.mdx b/nodejs/docs/codegen.mdx
index 8d1e5d1f0aa..8ce9ba2de0e 100644
--- a/nodejs/docs/codegen.mdx
+++ b/nodejs/docs/codegen.mdx
@@ -22,7 +22,7 @@ Install the VS Code extension and generate tests directly from VS Code. The exte
To record a test click on the **Record new** button from the Testing sidebar. This will create a `test-1.spec.ts` file as well as open up a browser window.
-
+
In the browser go to the URL you wish to test and start clicking around to record your user actions.
@@ -47,7 +47,7 @@ To record from a specific point in your test move your cursor to where you want
In the browser window start performing the actions you want to record.
-
+
In the test file in VS Code you will see your new generated actions added to your test at the cursor position.
@@ -60,7 +60,7 @@ You can generate locators with the test generator.
- Click the element you require and it will now show up in the **Pick locator** box in VS Code.
- Press Enter on your keyboard to copy the locator into the clipboard and then paste anywhere in your code. Or press 'escape' if you want to cancel.
-
+
## Generate tests with the Playwright Inspector
@@ -117,7 +117,7 @@ npx playwright codegen --viewport-size="800,600" playwright.dev
```
######
-
+
### Emulate devices
@@ -128,7 +128,7 @@ npx playwright codegen --device="iPhone 13" playwright.dev
```
######
-
+
### Emulate color scheme
@@ -139,7 +139,7 @@ npx playwright codegen --color-scheme=dark playwright.dev
```
######
-
+
### Emulate geolocation, language and timezone
@@ -152,7 +152,7 @@ npx playwright codegen --timezone="Europe/Rome" --geolocation="41.890221,12.4923
```
######
-
+
### Preserve authenticated state
@@ -163,13 +163,13 @@ npx playwright codegen github.com/microsoft/playwright --save-storage=auth.json
```
######
-
+
#### Login
After performing authentication and closing the browser, `auth.json` will contain the storage state which you can then reuse in your tests.
-
+
Make sure you only use the `auth.json` locally as it contains sensitive information. Add it to your `.gitignore` or delete it once you have finished generating your tests.
@@ -182,7 +182,7 @@ npx playwright codegen --load-storage=auth.json github.com/microsoft/playwright
```
######
-
+
#### Use existing userDataDir
@@ -245,6 +245,7 @@ const { chromium } = require('@playwright/test');
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/debug.mdx b/nodejs/docs/debug.mdx
index 891601de094..4ef1317a6cf 100644
--- a/nodejs/docs/debug.mdx
+++ b/nodejs/docs/debug.mdx
@@ -10,29 +10,29 @@ import HTMLCard from '@site/src/components/HTMLCard';
We recommend using the [VS Code Extension](./getting-started-vscode.mdx) for debugging for a better developer experience. With the VS Code extension you can debug your tests right in VS Code, see error messages, set breakpoints and step through your tests.
-
+
### Error Messages
If your test fails VS Code will show you error messages right in the editor showing what was expected, what was received as well as a complete call log.
-
+
### Live Debugging
You can debug your test live in VS Code. After running a test with the `Show Browser` option checked, click on any of the locators in VS Code and it will be highlighted in the Browser window. Playwright will also show you if there are multiple matches.
-
+
You can also edit the locators in VS Code and Playwright will show you the changes live in the browser window.
-
+
### Picking a Locator
Pick a [locator](./locators.mdx) and copy it into your test file by clicking the **Pick locator** button from the testing sidebar. Then in the browser click the element you require and it will now show up in the **Pick locator** box in VS Code. Press 'enter' on your keyboard to copy the locator into the clipboard and then paste anywhere in your code. Or press 'escape' if you want to cancel.
-
+
Playwright will look at your page and figure out the best locator, prioritizing [role, text and test id locators](./locators.mdx). If Playwright finds multiple elements matching the locator, it will improve the locator to make it resilient and uniquely identify the target element, so you don't have to worry about failing tests due to locators.
@@ -40,11 +40,11 @@ Playwright will look at your page and figure out the best locator, prioritizing
To set a breakpoint click next to the line number where you want the breakpoint to be until a red dot appears. Run the tests in debug mode by right clicking on the line next to the test you want to run.
-
+
A browser window will open and the test will run and pause at where the breakpoint is set. You can step through the tests, pause the test and rerun the tests from the menu in VS Code.
-
+
### Debug Tests Using Chrome DevTools
@@ -54,11 +54,11 @@ Instead of using `Debug Test`, choose `Run Test` in VS Code. With `Show Browser`
By default, debugging is done using the Chromium profile. You can debug your tests on different browsers by right clicking on the debug icon in the testing sidebar and clicking on the 'Select Default Profile' option from the dropdown.
-
+
Then choose the test profile you would like to use for debugging your tests. Each time you run your test in debug mode it will use the profile you selected. You can run tests in debug mode by right clicking the line number where your test is and selecting 'Debug Test' from the menu.
-
+
To learn more about debugging, see [Debugging in Visual Studio Code](https://code.visualstudio.com/docs/editor/debugging).
@@ -66,7 +66,7 @@ To learn more about debugging, see [Debugging in Visual Studio Code](https://cod
The Playwright Inspector is a GUI tool to help you debug your Playwright tests. It allows you to step through your tests, live edit locators, pick locators and see actionability logs.
-
+
### Run in debug mode
@@ -112,7 +112,7 @@ npx playwright test example.spec.ts:10 --project=webkit --debug
You can play, pause or step through each action of your test using the toolbar at the top of the Inspector. You can see the current action highlighted in the test code, and matching elements highlighted in the browser window.
-
+
### Run a test from a specific breakpoint
@@ -124,19 +124,19 @@ await page.pause();
Once you add a `page.pause()` call, run your tests in debug mode. Clicking the "Resume" button in the Inspector will run the test and only stop on the `page.pause()`.
-
+
### Live editing locators
While running in debug mode you can live edit the locators. Next to the 'Pick Locator' button there is a field showing the [locator](./locators.mdx) that the test is paused on. You can edit this locator directly in the **Pick Locator** field, and matching elements will be highlighted in the browser window.
-
+
### Picking locators
While debugging, you might need to choose a more resilient locator. You can do this by clicking on the **Pick Locator** button and hovering over any element in the browser window. While hovering over an element you will see the code needed to locate this element highlighted below. Clicking an element in the browser will add the locator into the field where you can then either tweak it or copy it into your code.
-
+
Playwright will look at your page and figure out the best locator, prioritizing [role, text and test id locators](./locators.mdx). If Playwright finds multiple elements matching the locator, it will improve the locator to make it resilient and uniquely identify the target element, so you don't have to worry about failing tests due to locators.
@@ -144,7 +144,7 @@ Playwright will look at your page and figure out the best locator, prioritizing
By the time Playwright has paused on a click action, it has already performed [actionability checks](./actionability.mdx) that can be found in the log. This can help you understand what happened during your test and what Playwright did or tried to do. The log tells you if the element was visible, enabled and stable, if the locator resolved to an element, scrolled into view, and so much more. If actionability can't be reached, it will show the action as pending.
-
+
## Trace Viewer
@@ -165,7 +165,7 @@ When running in Debug Mode with `PWDEBUG=console`, a `playwright` object is avai
- **See console logs** during execution (or learn how to [read logs via API](./api/class-page.mdx#page-event-console))
- Check **network activity** and other developer tools features
-
+
To debug your tests using the browser developer tools, start by setting a breakpoint in your test to pause the execution using the [page.pause()](/api/class-page.mdx#page-pause) method.
@@ -342,6 +342,7 @@ await chromium.launch({ headless: false, slowMo: 100 });
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/dialogs.mdx b/nodejs/docs/dialogs.mdx
index f4edfc81e2b..2a349c8c9f7 100644
--- a/nodejs/docs/dialogs.mdx
+++ b/nodejs/docs/dialogs.mdx
@@ -95,6 +95,7 @@ This will wait for the print dialog to be opened after the button is clicked. Ma
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/docker.mdx b/nodejs/docs/docker.mdx
index 9b509d14924..644f12a5d37 100644
--- a/nodejs/docs/docker.mdx
+++ b/nodejs/docs/docker.mdx
@@ -194,6 +194,7 @@ RUN npx -y playwright@1.58.2 install --with-deps
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/downloads.mdx b/nodejs/docs/downloads.mdx
index 82abba533c2..3d8a80537cb 100644
--- a/nodejs/docs/downloads.mdx
+++ b/nodejs/docs/downloads.mdx
@@ -71,6 +71,7 @@ For uploading files, see the [uploading files](./input.mdx#upload-files) section
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/emulation.mdx b/nodejs/docs/emulation.mdx
index d2e25119f5d..8b3b57577ec 100644
--- a/nodejs/docs/emulation.mdx
+++ b/nodejs/docs/emulation.mdx
@@ -61,7 +61,7 @@ const context = await browser.newContext({
-
+
## Viewport
@@ -269,7 +269,7 @@ const context = await browser.newContext({
-
+
######
Note that this only affects the browser timezone and locale, not the test runner timezone. To set the test runner timezone, you can use the [`TZ` environment variable](https://nodejs.org/api/cli.html#tz).
@@ -406,7 +406,7 @@ const context = await browser.newContext({
-
+
Change the location later:
@@ -506,7 +506,7 @@ await page.emulateMedia({ media: 'print' });
-
+
## User Agent
@@ -621,6 +621,7 @@ const context = await browser.newContext({
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/evaluating.mdx b/nodejs/docs/evaluating.mdx
index d391a59e698..1dd853b060f 100644
--- a/nodejs/docs/evaluating.mdx
+++ b/nodejs/docs/evaluating.mdx
@@ -164,6 +164,7 @@ test.beforeEach(async ({ page }) => {
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/events.mdx b/nodejs/docs/events.mdx
index 89078f875fd..6d30972b412 100644
--- a/nodejs/docs/events.mdx
+++ b/nodejs/docs/events.mdx
@@ -84,6 +84,7 @@ await page.evaluate("prompt('Enter a number:')");
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/extensibility.mdx b/nodejs/docs/extensibility.mdx
index f1bb876f51c..fcf3092c6e3 100644
--- a/nodejs/docs/extensibility.mdx
+++ b/nodejs/docs/extensibility.mdx
@@ -91,6 +91,7 @@ test('selector engine test', async ({ page }) => {
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/frames.mdx b/nodejs/docs/frames.mdx
index beb4286b3c4..09aa5e0f4be 100644
--- a/nodejs/docs/frames.mdx
+++ b/nodejs/docs/frames.mdx
@@ -60,6 +60,7 @@ await frame.fill('#username-input', 'John');
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/getting-started-vscode.mdx b/nodejs/docs/getting-started-vscode.mdx
index 2f3acf27c20..faad317482e 100644
--- a/nodejs/docs/getting-started-vscode.mdx
+++ b/nodejs/docs/getting-started-vscode.mdx
@@ -170,6 +170,7 @@ If you have multiple `playwright.config.ts` files, you can switch between them u
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/handles.mdx b/nodejs/docs/handles.mdx
index ac04b1f9312..7befb0509e0 100644
--- a/nodejs/docs/handles.mdx
+++ b/nodejs/docs/handles.mdx
@@ -144,6 +144,7 @@ await locator.click();
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/input.mdx b/nodejs/docs/input.mdx
index f7205dde1d0..cb8617385e8 100644
--- a/nodejs/docs/input.mdx
+++ b/nodejs/docs/input.mdx
@@ -291,6 +291,7 @@ await page.getByTestId('scrolling-container').evaluate(e => e.scrollTop += 100);
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/intro.mdx b/nodejs/docs/intro.mdx
index 7b7842a18d4..c8c052a61d6 100644
--- a/nodejs/docs/intro.mdx
+++ b/nodejs/docs/intro.mdx
@@ -296,6 +296,7 @@ pnpm exec playwright --version
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/languages.mdx b/nodejs/docs/languages.mdx
index 2c74e6459bc..5c8e06eb87c 100644
--- a/nodejs/docs/languages.mdx
+++ b/nodejs/docs/languages.mdx
@@ -61,6 +61,7 @@ Playwright for .NET comes with MSTest, NUnit, xUnit, and xUnit v3 [base classes]
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/library.mdx b/nodejs/docs/library.mdx
index a355947e1cc..30220bf013f 100644
--- a/nodejs/docs/library.mdx
+++ b/nodejs/docs/library.mdx
@@ -448,6 +448,7 @@ let page: import('playwright').Page;
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/locators.mdx b/nodejs/docs/locators.mdx
index 017a3649460..a4d020a1115 100644
--- a/nodejs/docs/locators.mdx
+++ b/nodejs/docs/locators.mdx
@@ -942,6 +942,7 @@ For less commonly used locators, look at the [other locators](./other-locators.m
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/mock-browser.mdx b/nodejs/docs/mock-browser.mdx
index 85fe84f4e59..764ddd55f7f 100644
--- a/nodejs/docs/mock-browser.mdx
+++ b/nodejs/docs/mock-browser.mdx
@@ -191,6 +191,7 @@ test('update battery status (no golden)', async ({ page }) => {
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/mock.mdx b/nodejs/docs/mock.mdx
index 439a7416aee..e2b6c97a419 100644
--- a/nodejs/docs/mock.mdx
+++ b/nodejs/docs/mock.mdx
@@ -204,6 +204,7 @@ For more details, see [WebSocketRoute].
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/navigations.mdx b/nodejs/docs/navigations.mdx
index ffb7a600444..9bd8390426b 100644
--- a/nodejs/docs/navigations.mdx
+++ b/nodejs/docs/navigations.mdx
@@ -103,6 +103,7 @@ Playwright splits the process of showing a new document in a page into **navigat
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/network.mdx b/nodejs/docs/network.mdx
index f144d41ebd3..bb2b2dea54f 100644
--- a/nodejs/docs/network.mdx
+++ b/nodejs/docs/network.mdx
@@ -368,6 +368,7 @@ If you're interested in not solely using Service Workers for testing and network
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/other-locators.mdx b/nodejs/docs/other-locators.mdx
index 092953389d5..f22d18c5efa 100644
--- a/nodejs/docs/other-locators.mdx
+++ b/nodejs/docs/other-locators.mdx
@@ -99,7 +99,7 @@ Consider a page with two buttons, first invisible and second visible.
### CSS: elements that contain other elements
-The `:has()` pseudo-class is an [experimental CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:has). It returns an element if any of the selectors passed as parameters relative to the `:scope` of the given element match at least one element.
+The `:has()` pseudo-class is a [CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:has). It returns an element if any of the selectors passed as parameters relative to the `:scope` of the given element match at least one element.
Following snippet returns text content of an `` element that has a `
` inside.
@@ -116,7 +116,7 @@ Comma-separated list of CSS selectors will match all elements that can be select
await page.locator('button:has-text("Log in"), button:has-text("Sign in")').click();
```
-The `:is()` pseudo-class is an [experimental CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:is) that may be useful for specifying a list of extra conditions on an element.
+The `:is()` pseudo-class is a [CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:is) that may be useful for specifying a list of extra conditions on an element.
### CSS: matching elements based on layout
@@ -165,9 +165,19 @@ It is usually possible to distinguish elements by some attribute or text content
Sometimes page contains a number of similar elements, and it is hard to select a particular one. For example:
```html
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
```
In this case, `:nth-match(:text("Buy"), 3)` will select the third button from the snippet above. Note that index is one-based.
@@ -421,6 +431,7 @@ For example, `css=article >> text=Hello` captures the element with the text `Hel
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/pages.mdx b/nodejs/docs/pages.mdx
index a32c565c46d..45da7abe0f0 100644
--- a/nodejs/docs/pages.mdx
+++ b/nodejs/docs/pages.mdx
@@ -117,6 +117,7 @@ page.on('popup', async popup => {
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/pom.mdx b/nodejs/docs/pom.mdx
index 9e5541d9c2e..40ce6d09440 100644
--- a/nodejs/docs/pom.mdx
+++ b/nodejs/docs/pom.mdx
@@ -193,6 +193,7 @@ await expect(playwrightDev.tocList).toHaveText([
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/protractor.mdx b/nodejs/docs/protractor.mdx
index e55b9131c65..e0607866e62 100644
--- a/nodejs/docs/protractor.mdx
+++ b/nodejs/docs/protractor.mdx
@@ -193,6 +193,7 @@ Learn more about Playwright Test runner:
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/puppeteer.mdx b/nodejs/docs/puppeteer.mdx
index 702f4ffdce2..3d851433605 100644
--- a/nodejs/docs/puppeteer.mdx
+++ b/nodejs/docs/puppeteer.mdx
@@ -198,6 +198,7 @@ Learn more about Playwright Test runner:
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/release-notes.mdx b/nodejs/docs/release-notes.mdx
index c381d5bbcd4..df501d402d0 100644
--- a/nodejs/docs/release-notes.mdx
+++ b/nodejs/docs/release-notes.mdx
@@ -3195,6 +3195,7 @@ This version of Playwright was also tested against the following stable channels
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/running-tests.mdx b/nodejs/docs/running-tests.mdx
index 60ad9137b96..45051abdacd 100644
--- a/nodejs/docs/running-tests.mdx
+++ b/nodejs/docs/running-tests.mdx
@@ -198,6 +198,7 @@ You can filter and search for tests as well as click on each test to see the tes
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/screenshots.mdx b/nodejs/docs/screenshots.mdx
index 91f913c6bbc..1e512e007f5 100644
--- a/nodejs/docs/screenshots.mdx
+++ b/nodejs/docs/screenshots.mdx
@@ -68,6 +68,7 @@ await page.locator('.header').screenshot({ path: 'screenshot.png' });
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/selenium-grid.mdx b/nodejs/docs/selenium-grid.mdx
index 5a0a41842d2..4f716eb7cff 100644
--- a/nodejs/docs/selenium-grid.mdx
+++ b/nodejs/docs/selenium-grid.mdx
@@ -150,6 +150,7 @@ This means that Selenium 3 is supported in a best-effort manner, where Playwrigh
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/service-workers.mdx b/nodejs/docs/service-workers.mdx
index a613b74d717..876f65a9294 100644
--- a/nodejs/docs/service-workers.mdx
+++ b/nodejs/docs/service-workers.mdx
@@ -156,6 +156,7 @@ Requests for updated Service Worker main script code currently cannot be routed
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-agents.mdx b/nodejs/docs/test-agents.mdx
index 381361eed2f..d4a2ffb1df5 100644
--- a/nodejs/docs/test-agents.mdx
+++ b/nodejs/docs/test-agents.mdx
@@ -280,6 +280,7 @@ Seed tests provide a ready-to-use `page` context to bootstrap execution.
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-annotations.mdx b/nodejs/docs/test-annotations.mdx
index 4c124037488..ebb8f721fcd 100644
--- a/nodejs/docs/test-annotations.mdx
+++ b/nodejs/docs/test-annotations.mdx
@@ -344,6 +344,7 @@ test('example test', async ({ page, browser }) => {
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-assertions.mdx b/nodejs/docs/test-assertions.mdx
index b2b3aa53597..c6bba8e477b 100644
--- a/nodejs/docs/test-assertions.mdx
+++ b/nodejs/docs/test-assertions.mdx
@@ -386,6 +386,7 @@ test('passes', async ({ database }) => {
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-cli.mdx b/nodejs/docs/test-cli.mdx
index 8aaeec4b990..fe9126068c1 100644
--- a/nodejs/docs/test-cli.mdx
+++ b/nodejs/docs/test-cli.mdx
@@ -109,7 +109,7 @@ npx playwright test --ui
| `--test-list ` | Path to a file containing a list of tests to run. See [test list](#test-list) for details. |
| `--test-list-invert ` | Path to a file containing a list of tests to skip. See [test list](#test-list) for details. |
| `--timeout ` | Specify test timeout threshold in milliseconds, zero for unlimited (default: 30 seconds). |
-| `--trace ` | Force tracing mode, can be `on`, `off`, `on-first-retry`, `on-all-retries`, `retain-on-failure`, `retain-on-first-failure`. |
+| `--trace ` | Force tracing mode, can be `on`, `off`, `on-first-retry`, `on-all-retries`, `retain-on-failure`, `retain-on-first-failure`, `retain-on-failure-and-retries`. |
| `--tsconfig ` | Path to a single tsconfig applicable to all imported files (default: look up tsconfig for each imported file separately). |
| `--ui` | Run tests in interactive UI mode. |
| `--ui-host ` | Host to serve UI on; specifying this option opens UI in a browser tab. |
@@ -356,6 +356,7 @@ npx playwright clear-cache
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-components.mdx b/nodejs/docs/test-components.mdx
index 9d8cebcb6e5..19630c1f4df 100644
--- a/nodejs/docs/test-components.mdx
+++ b/nodejs/docs/test-components.mdx
@@ -784,6 +784,7 @@ Accessing a component's internal methods or its instance within test code is nei
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-configuration.mdx b/nodejs/docs/test-configuration.mdx
index e97413d59ca..d4328cc7497 100644
--- a/nodejs/docs/test-configuration.mdx
+++ b/nodejs/docs/test-configuration.mdx
@@ -180,6 +180,7 @@ export default defineConfig({
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-fixtures.mdx b/nodejs/docs/test-fixtures.mdx
index 54b7fd49080..e0dac1aaaf1 100644
--- a/nodejs/docs/test-fixtures.mdx
+++ b/nodejs/docs/test-fixtures.mdx
@@ -883,6 +883,7 @@ Note that the fixtures will still run once per [worker process](./test-parallel.
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-global-setup-teardown.mdx b/nodejs/docs/test-global-setup-teardown.mdx
index 292955d8bd3..02da447e207 100644
--- a/nodejs/docs/test-global-setup-teardown.mdx
+++ b/nodejs/docs/test-global-setup-teardown.mdx
@@ -301,6 +301,7 @@ export default globalSetup;
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-parallel.mdx b/nodejs/docs/test-parallel.mdx
index 81b3483127d..5aa40765713 100644
--- a/nodejs/docs/test-parallel.mdx
+++ b/nodejs/docs/test-parallel.mdx
@@ -309,6 +309,7 @@ Do not define your tests directly in a helper file. This could lead to unexpecte
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-parameterize.mdx b/nodejs/docs/test-parameterize.mdx
index caa783e4b25..7a24e8bdc9b 100644
--- a/nodejs/docs/test-parameterize.mdx
+++ b/nodejs/docs/test-parameterize.mdx
@@ -446,6 +446,7 @@ for (const record of records) {
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-projects.mdx b/nodejs/docs/test-projects.mdx
index 11e228fe413..cf06b3f9098 100644
--- a/nodejs/docs/test-projects.mdx
+++ b/nodejs/docs/test-projects.mdx
@@ -95,11 +95,11 @@ Running 1 test using 1 worker
The VS Code test runner runs your tests on the default browser of Chrome. To run on other/multiple browsers click the play button's dropdown from the testing sidebar and choose another profile or modify the default profile by clicking **Select Default Profile** and select the browsers you wish to run your tests on.
-
+
Choose a specific profile, various profiles or all profiles to run tests on.
-
+
## Configure projects for multiple environments
@@ -198,7 +198,7 @@ Running order:
2. Tests in the 'chromium', 'webkit' and 'firefox' projects run together. By default, these projects will [run in parallel](./test-parallel.mdx), subject to the maximum workers limit.
-
+
If there are more than one dependency then these project dependencies will be run first and in parallel. If the tests from a dependency fails then the tests that rely on this project will not be run.
@@ -208,13 +208,13 @@ Running order:
- ❌ 'DataBase' fails!
1. The 'e2e tests' project is not run!
-
+
### Teardown
You can also teardown your setup by adding a [testProject.teardown](/api/class-testproject.mdx#test-project-teardown) property to your setup project. Teardown will run after all dependent projects have run. See the [teardown guide](./test-global-setup-teardown.mdx#teardown) for more information.
-
+
### Test filtering
@@ -253,6 +253,7 @@ Projects can be also used to parametrize tests with your custom configuration -
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-reporters.mdx b/nodejs/docs/test-reporters.mdx
index ea1220db44f..c5468584e7c 100644
--- a/nodejs/docs/test-reporters.mdx
+++ b/nodejs/docs/test-reporters.mdx
@@ -524,6 +524,7 @@ Here's a short list of open source reporter implementations that you can take a
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-retries.mdx b/nodejs/docs/test-retries.mdx
index 35168695730..71feff127da 100644
--- a/nodejs/docs/test-retries.mdx
+++ b/nodejs/docs/test-retries.mdx
@@ -269,6 +269,7 @@ test('runs second', async () => {
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-sharding.mdx b/nodejs/docs/test-sharding.mdx
index b84e736c6b8..240a63515ba 100644
--- a/nodejs/docs/test-sharding.mdx
+++ b/nodejs/docs/test-sharding.mdx
@@ -157,7 +157,7 @@ jobs:
You can now see the reports have been merged and a combined HTML report is available in the GitHub Actions Artifacts tab.
-
+
## Merging reports from multiple environments
@@ -236,6 +236,7 @@ Supported options:
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-snapshots.mdx b/nodejs/docs/test-snapshots.mdx
index 9fc1bd28fc5..8cb7996554f 100644
--- a/nodejs/docs/test-snapshots.mdx
+++ b/nodejs/docs/test-snapshots.mdx
@@ -166,6 +166,7 @@ Snapshots are stored next to the test file, in a separate directory. For example
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-timeouts.mdx b/nodejs/docs/test-timeouts.mdx
index d2a559db00f..f3c9897fe51 100644
--- a/nodejs/docs/test-timeouts.mdx
+++ b/nodejs/docs/test-timeouts.mdx
@@ -237,6 +237,7 @@ API reference: [test.extend()](/api/class-test.mdx#test-extend).
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-typescript.mdx b/nodejs/docs/test-typescript.mdx
index 27ece058605..229321d0dce 100644
--- a/nodejs/docs/test-typescript.mdx
+++ b/nodejs/docs/test-typescript.mdx
@@ -165,6 +165,7 @@ Then `npm run test` will build the tests and run them.
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-ui-mode.mdx b/nodejs/docs/test-ui-mode.mdx
index c7854e2860b..57c60d7b871 100644
--- a/nodejs/docs/test-ui-mode.mdx
+++ b/nodejs/docs/test-ui-mode.mdx
@@ -159,6 +159,7 @@ Be aware that when specifying the `--ui-host=0.0.0.0` flag, UI Mode with your tr
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-use-options.mdx b/nodejs/docs/test-use-options.mdx
index 74540a81ebb..bd6e02cb4e6 100644
--- a/nodejs/docs/test-use-options.mdx
+++ b/nodejs/docs/test-use-options.mdx
@@ -374,6 +374,7 @@ test('no base url', async ({ page }) => {
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/test-webserver.mdx b/nodejs/docs/test-webserver.mdx
index e4628e45860..f55ab50da7b 100644
--- a/nodejs/docs/test-webserver.mdx
+++ b/nodejs/docs/test-webserver.mdx
@@ -158,6 +158,7 @@ export default defineConfig({
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/testing-library.mdx b/nodejs/docs/testing-library.mdx
index 33106428527..ca9933983a0 100644
--- a/nodejs/docs/testing-library.mdx
+++ b/nodejs/docs/testing-library.mdx
@@ -181,6 +181,7 @@ Learn more about Playwright Test runner:
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/touch-events.mdx b/nodejs/docs/touch-events.mdx
index dbea4d83e48..8c14e180620 100644
--- a/nodejs/docs/touch-events.mdx
+++ b/nodejs/docs/touch-events.mdx
@@ -169,6 +169,7 @@ test(`pinch in gesture to zoom out the map`, async ({ page }) => {
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/trace-viewer-intro.mdx b/nodejs/docs/trace-viewer-intro.mdx
index 183c4e1e55e..8d995db1341 100644
--- a/nodejs/docs/trace-viewer-intro.mdx
+++ b/nodejs/docs/trace-viewer-intro.mdx
@@ -101,6 +101,7 @@ To learn more about traces, check out our detailed guide on [Trace Viewer](/trac
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/trace-viewer.mdx b/nodejs/docs/trace-viewer.mdx
index b7c9329436b..4bcad87ab86 100644
--- a/nodejs/docs/trace-viewer.mdx
+++ b/nodejs/docs/trace-viewer.mdx
@@ -29,7 +29,7 @@ npx playwright show-trace path/to/trace.zip
Trace Viewer loads the trace entirely in your browser and does not transmit any data externally.
-
+
### Viewing remote traces
@@ -238,6 +238,7 @@ The "Attachments" tab allows you to explore attachments. If you're doing [visual
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/videos.mdx b/nodejs/docs/videos.mdx
index 008ec457255..bae216cbe05 100644
--- a/nodejs/docs/videos.mdx
+++ b/nodejs/docs/videos.mdx
@@ -129,6 +129,7 @@ Note that the video is only available after the page or browser context is close
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/webview2.mdx b/nodejs/docs/webview2.mdx
index ee885bf612b..75fe9f627dd 100644
--- a/nodejs/docs/webview2.mdx
+++ b/nodejs/docs/webview2.mdx
@@ -144,6 +144,7 @@ For debugging tests, see the Playwright [Debugging guide](./debug).
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/nodejs/docs/writing-tests.mdx b/nodejs/docs/writing-tests.mdx
index bd58503ceaf..137a48fc0e2 100644
--- a/nodejs/docs/writing-tests.mdx
+++ b/nodejs/docs/writing-tests.mdx
@@ -197,6 +197,7 @@ test.describe('navigation', () => {
[Frame]: /api/class-frame.mdx "Frame"
[FrameLocator]: /api/class-framelocator.mdx "FrameLocator"
[GenericAssertions]: /api/class-genericassertions.mdx "GenericAssertions"
+[Inspector]: /api/class-inspector.mdx "Inspector"
[JSHandle]: /api/class-jshandle.mdx "JSHandle"
[Keyboard]: /api/class-keyboard.mdx "Keyboard"
[Locator]: /api/class-locator.mdx "Locator"
diff --git a/python/docs/api/class-browsertype.mdx b/python/docs/api/class-browsertype.mdx
index 38c909a7e89..55b1452c110 100644
--- a/python/docs/api/class-browsertype.mdx
+++ b/python/docs/api/class-browsertype.mdx
@@ -235,6 +235,9 @@ browser = await playwright.chromium.launch( # or "firefox" or "webkit".
:::
Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/).
+- `artifacts_dir` [Union]\[[str], [pathlib.Path]\] *(optional)*#
+
+ If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes.
- `channel` [str] *(optional)*#
Browser distribution channel.
@@ -344,6 +347,9 @@ browser_type.launch_persistent_context(user_data_dir, **kwargs)
:::
Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/).
+- `artifacts_dir` [Union]\[[str], [pathlib.Path]\] *(optional)*#
+
+ If specified, artifacts (traces, videos, downloads, HAR files, etc.) are saved into this directory. The directory is not cleaned up when the browser closes. If not specified, a temporary directory is used and cleaned up when the browser closes.
- `base_url` [str] *(optional)*#
When using [page.goto()](/api/class-page.mdx#page-goto), [page.route()](/api/class-page.mdx#page-route), [page.wait_for_url()](/api/class-page.mdx#page-wait-for-url), [page.expect_request()](/api/class-page.mdx#page-wait-for-request), or [page.expect_response()](/api/class-page.mdx#page-wait-for-response) it takes the base URL in consideration by using the [`URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor for building the corresponding URL. Unset by default. Examples:
diff --git a/python/docs/api/class-response.mdx b/python/docs/api/class-response.mdx
index cfd1d5ec254..39bade46b2f 100644
--- a/python/docs/api/class-response.mdx
+++ b/python/docs/api/class-response.mdx
@@ -132,6 +132,23 @@ response.headers_array()
---
+### http_version {#response-http-version}
+
+Added in: v1.59response.http_version
+
+Returns the http version used by the response.
+
+**Usage**
+
+```python
+response.http_version()
+```
+
+**Returns**
+- [str]#
+
+---
+
### json {#response-json}
Added before v1.9response.json
diff --git a/python/docs/browsers.mdx b/python/docs/browsers.mdx
index 76ba4dcdb57..19d8de87910 100644
--- a/python/docs/browsers.mdx
+++ b/python/docs/browsers.mdx
@@ -496,7 +496,7 @@ playwright install
-When running Playwright scripts, ask it to search for browsers in a shared location.
+When running Playwright scripts, ask Playwright to search for browsers in a shared location.
+
## Opening the Workflows
diff --git a/python/docs/codegen.mdx b/python/docs/codegen.mdx
index 53df9627ddd..40b936f4f82 100644
--- a/python/docs/codegen.mdx
+++ b/python/docs/codegen.mdx
@@ -67,7 +67,7 @@ playwright codegen --viewport-size="800,600" playwright.dev
```
######
-
+
### Emulate devices
@@ -78,7 +78,7 @@ playwright codegen --device="iPhone 13" playwright.dev
```
######
-
+
### Emulate color scheme
@@ -89,7 +89,7 @@ playwright codegen --color-scheme=dark playwright.dev
```
######
-
+
### Emulate geolocation, language and timezone
@@ -102,7 +102,7 @@ playwright codegen --timezone="Europe/Rome" --geolocation="41.890221,12.492348"
```
######
-
+
### Preserve authenticated state
@@ -113,13 +113,13 @@ playwright codegen github.com/microsoft/playwright --save-storage=auth.json
```
######
-
+
#### Login
After performing authentication and closing the browser, `auth.json` will contain the storage state which you can then reuse in your tests.
-
+
Make sure you only use the `auth.json` locally as it contains sensitive information. Add it to your `.gitignore` or delete it once you have finished generating your tests.
@@ -132,7 +132,7 @@ playwright codegen --load-storage=auth.json github.com/microsoft/playwright
```
######
-
+
#### Use existing userDataDir
diff --git a/python/docs/debug.mdx b/python/docs/debug.mdx
index 928dbd83dd3..425609d9fae 100644
--- a/python/docs/debug.mdx
+++ b/python/docs/debug.mdx
@@ -10,7 +10,7 @@ import HTMLCard from '@site/src/components/HTMLCard';
The Playwright Inspector is a GUI tool to help you debug your Playwright tests. It allows you to step through your tests, live edit locators, pick locators and see actionability logs.
-
+
### Run in debug mode
@@ -56,7 +56,7 @@ pytest -s
You can play, pause or step through each action of your test using the toolbar at the top of the Inspector. You can see the current action highlighted in the test code, and matching elements highlighted in the browser window.
-
+
### Run a test from a specific breakpoint
@@ -88,19 +88,19 @@ await page.pause()
Once you add a `page.pause()` call, run your tests in debug mode. Clicking the "Resume" button in the Inspector will run the test and only stop on the `page.pause()`.
-
+
### Live editing locators
While running in debug mode you can live edit the locators. Next to the 'Pick Locator' button there is a field showing the [locator](./locators.mdx) that the test is paused on. You can edit this locator directly in the **Pick Locator** field, and matching elements will be highlighted in the browser window.
-
+
### Picking locators
While debugging, you might need to choose a more resilient locator. You can do this by clicking on the **Pick Locator** button and hovering over any element in the browser window. While hovering over an element you will see the code needed to locate this element highlighted below. Clicking an element in the browser will add the locator into the field where you can then either tweak it or copy it into your code.
-
+
Playwright will look at your page and figure out the best locator, prioritizing [role, text and test id locators](./locators.mdx). If Playwright finds multiple elements matching the locator, it will improve the locator to make it resilient and uniquely identify the target element, so you don't have to worry about failing tests due to locators.
@@ -108,7 +108,7 @@ Playwright will look at your page and figure out the best locator, prioritizing
By the time Playwright has paused on a click action, it has already performed [actionability checks](./actionability.mdx) that can be found in the log. This can help you understand what happened during your test and what Playwright did or tried to do. The log tells you if the element was visible, enabled and stable, if the locator resolved to an element, scrolled into view, and so much more. If actionability can't be reached, it will show the action as pending.
-
+
## Trace Viewer
@@ -129,7 +129,7 @@ When running in Debug Mode with `PWDEBUG=console`, a `playwright` object is avai
- **See console logs** during execution (or learn how to [read logs via API](./api/class-page.mdx#page-event-console))
- Check **network activity** and other developer tools features
-
+
To debug your tests using the browser developer tools, start by setting a breakpoint in your test to pause the execution using the [page.pause()](/api/class-page.mdx#page-pause) method.
diff --git a/python/docs/emulation.mdx b/python/docs/emulation.mdx
index 5f76a7b0e1d..229df534fdb 100644
--- a/python/docs/emulation.mdx
+++ b/python/docs/emulation.mdx
@@ -61,7 +61,7 @@ asyncio.run(main())
-
+
## Viewport
@@ -185,7 +185,7 @@ context = await browser.new_context(
-
+
## Permissions
@@ -305,7 +305,7 @@ context = await browser.new_context(
-
+
Change the location later:
@@ -391,7 +391,7 @@ await page.emulate_media(media='print')
-
+
## User Agent
diff --git a/python/docs/other-locators.mdx b/python/docs/other-locators.mdx
index 0713cac44ba..cc94452371b 100644
--- a/python/docs/other-locators.mdx
+++ b/python/docs/other-locators.mdx
@@ -198,7 +198,7 @@ Consider a page with two buttons, first invisible and second visible.
### CSS: elements that contain other elements
-The `:has()` pseudo-class is an [experimental CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:has). It returns an element if any of the selectors passed as parameters relative to the `:scope` of the given element match at least one element.
+The `:has()` pseudo-class is a [CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:has). It returns an element if any of the selectors passed as parameters relative to the `:scope` of the given element match at least one element.
Following snippet returns text content of an `` element that has a `
` inside.
@@ -256,7 +256,7 @@ await page.locator('button:has-text("Log in"), button:has-text("Sign in")').clic
-The `:is()` pseudo-class is an [experimental CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:is) that may be useful for specifying a list of extra conditions on an element.
+The `:is()` pseudo-class is a [CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/:is) that may be useful for specifying a list of extra conditions on an element.
### CSS: matching elements based on layout
@@ -332,9 +332,19 @@ It is usually possible to distinguish elements by some attribute or text content
Sometimes page contains a number of similar elements, and it is hard to select a particular one. For example:
```html
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
```
In this case, `:nth-match(:text("Buy"), 3)` will select the third button from the snippet above. Note that index is one-based.
diff --git a/python/docs/trace-viewer.mdx b/python/docs/trace-viewer.mdx
index 0631441c6ff..86b13fdd18e 100644
--- a/python/docs/trace-viewer.mdx
+++ b/python/docs/trace-viewer.mdx
@@ -26,7 +26,7 @@ playwright show-trace trace.zip
Trace Viewer loads the trace entirely in your browser and does not transmit any data externally.
-
+
### Viewing remote traces