v1.53.0
-
New method locator.describe() to describe a locator. Used for trace viewer.
Locator button = page.getByTestId("btn-sub").describe("Subscribe button"); button.click();
-
mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install --list"
will now list all installed browsers, versions and locations.
- Chromium 138.0.7204.4
- Mozilla Firefox 139.0
- WebKit 18.5
This version was also tested against the following stable channels:
- Google Chrome 137
- Microsoft Edge 137
v1.53.0
-
New method locator.describe() to describe a locator. Used for trace viewer.
Locator button = page.getByTestId("btn-sub").describe("Subscribe button"); button.click();
-
mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install --list"
will now list all installed browsers, versions and locations.
- Chromium 138.0.7204.4
- Mozilla Firefox 139.0
- WebKit 18.5
This version was also tested against the following stable channels:
- Google Chrome 137
- Microsoft Edge 137
v1.52.0
-
New method assertThat(locator).containsClass() to ergonomically assert individual class names on the element.
assertThat(page.getByRole(AriaRole.LISTITEM, new Page.GetByRoleOptions().setName("Ship v1.52"))) .containsClass("done");
-
Aria Snapshots got two new properties:
/children
for strict matching and/url
for links.assertThat(locator).matchesAriaSnapshot(""" - list - /children: equal - listitem: Feature A - listitem: - link "Feature B": - /url: "https://playwright.dev" """);
- New option
setMaxRedirects
in apiRequest.newContext() to control the maximum number of redirects. - New option
setRef
in locator.ariaSnapshot() to generate reference for each element in the snapshot which can later be used to locate the element.
- Method route.continue() does not allow to override the
Cookie
header anymore. If aCookie
header is provided, it will be ignored, and the cookie will be loaded from the browser's cookie store. To set custom cookies, use browserContext.addCookies(). - macOS 13 is now deprecated and will no longer receive WebKit updates. Please upgrade to a more recent macOS version to continue benefiting from the latest WebKit improvements.
- Chromium 136.0.7103.25
- Mozilla Firefox 137.0
- WebKit 18.4
This version was also tested against the following stable channels:
- Google Chrome 135
- Microsoft Edge 135
v1.51.0
-
New option
setIndexedDB
for browserContext.storageState() allows to save and restore IndexedDB contents. Useful when your application uses IndexedDB API to store authentication tokens, like Firebase Authentication.Here is an example following the authentication guide:
// Save storage state into the file. Make sure to include IndexedDB. context.storageState(new BrowserContext.StorageStateOptions() .setPath(Paths.get("state.json")) .setIndexedDB(true)); // Create a new context with the saved storage state. BrowserContext context = browser.newContext(new Browser.NewContextOptions() .setStorageStatePath(Paths.get("state.json")));
-
New option
setVisible
for locator.filter() allows matching only visible elements.// Ignore invisible todo items. Locator todoItems = page.getByTestId("todo-item") .filter(new Locator.FilterOptions().setVisible(true)); // Check there are exactly 3 visible ones. assertThat(todoItems).hasCount(3);
-
New option
setContrast
for methods page.emulateMedia() and browser.newContext() allows to emulate theprefers-contrast
media feature. -
New option
setFailOnStatusCode
makes all fetch requests made through the APIRequestContext throw on response codes other than 2xx and 3xx.
- Chromium 134.0.6998.35
- Mozilla Firefox 135.0
- WebKit 18.4
This version was also tested against the following stable channels:
- Google Chrome 133
- Microsoft Edge 133
v1.50.0
- Added method assertThat(locator).hasAccessibleErrorMessage() to assert the Locator points to an element with a given aria errormessage.
- New button in Codegen for picking elements to produce aria snapshots.
- Additional details (such as keys pressed) are now displayed alongside action API calls in traces.
- Display of
canvas
content in traces is error-prone. Display is now disabled by default, and can be enabled via theDisplay canvas content
UI setting. Call
andNetwork
panels now display additional time information.
- assertThat(locator).isEditable() and locator.isEditable() now throw if the target element is not
<input>
,<select>
, or a number of other editable elements.
- Chromium 133.0.6943.16
- Mozilla Firefox 134.0
- WebKit 18.2
This version was also tested against the following stable channels:
- Google Chrome 132
- Microsoft Edge 132
v1.49.0
New assertion assertThat(locator).matchesAriaSnapshot() verifies page structure by comparing to an expected accessibility tree, represented as YAML.
page.navigate("https://playwright.dev");
assertThat(page.locator("body")).matchesAriaSnapshot("""
- banner:
- heading /Playwright enables reliable/ [level=1]
- link "Get started"
- link "Star microsoft/playwright on GitHub"
- main:
- img "Browsers (Chromium, Firefox, WebKit)"
- heading "Any browser • Any platform • One API"
""");
You can generate this assertion with Test Generator or by calling locator.ariaSnapshot().
Learn more in the aria snapshots guide.
New method tracing.group() allows you to visually group actions in the trace viewer.
// All actions between group and groupEnd
// will be shown in the trace viewer as a group.
page.context().tracing().group("Open Playwright.dev > API");
page.navigate("https://playwright.dev/");
page.getByRole(AriaRole.LINK, new Page.GetByRoleOptions().setName("API")).click();
page.context().tracing().groupEnd();
This change affects you if you're using one of the following channels in your playwright.config.ts
:
chrome
,chrome-dev
,chrome-beta
, orchrome-canary
msedge
,msedge-dev
,msedge-beta
, ormsedge-canary
After updating to Playwright v1.49, run your test suite. If it still passes, you're good to go. If not, you will probably need to update your snapshots, and adapt some of your test code around PDF viewers and extensions. See issue #33566 for more details.
You can opt into the new headless mode by using 'chromium'
channel. As official Chrome documentation puts it:
New Headless on the other hand is the real Chrome browser, and is thus more authentic, reliable, and offers more features. This makes it more suitable for high-accuracy end-to-end web app testing or browser extension testing.
See issue #33566 for the list of possible breakages you could encounter and more details on Chromium headless. Please file an issue if you see any problems after opting in.
Browser browser = playwright.chromium().launch(new BrowserType.LaunchOptions().setChannel("chromium"));
- There will be no more updates for WebKit on Ubuntu 20.04 and Debian 11. We recommend updating your OS to a later version.
<canvas>
elements inside a snapshot now draw a preview.
- Chromium 131.0.6778.33
- Mozilla Firefox 132.0
- WebKit 18.2
This version was also tested against the following stable channels:
- Google Chrome 130
- Microsoft Edge 130
v1.48.0
New methods page.routeWebSocket() and browserContext.routeWebSocket() allow to intercept, modify and mock WebSocket connections initiated in the page. Below is a simple example that mocks WebSocket communication by responding to a "request"
with a "response"
.
page.routeWebSocket("/ws", ws -> {
ws.onMessage(message -> {
if ("request".equals(message))
ws.send("response");
});
});
See WebSocketRoute for more details.
- New "copy" buttons for annotations and test location in the HTML report.
- Route method calls like route.fulfill() are not shown in the report and trace viewer anymore. You can see which network requests were routed in the network tab instead.
- New "Copy as cURL" and "Copy as fetch" buttons for requests in the network tab.
- New method page.requestGC() may help detect memory leaks.
- Requests made by APIRequestContext now record detailed timing and security information in the HAR.
- Chromium 130.0.6723.19
- Mozilla Firefox 130.0
- WebKit 18.0
This version was also tested against the following stable channels:
- Google Chrome 129
- Microsoft Edge 129
v1.47.0
The Network tab in the trace viewer has several nice improvements:
- filtering by asset type and URL
- better display of query string parameters
- preview of font assets
- The
mcr.microsoft.com/playwright/java:v1.47.0
now serves a Playwright image based on Ubuntu 24.04 Noble. To use the 22.02 jammy-based image, please usemcr.microsoft.com/playwright/java:v1.47.0-jammy
instead. - The
:latest
/:focal
/:jammy
tag for Playwright Docker images is no longer being published. Pin to a specific version for better stability and reproducibility. - TLS client certificates can now be passed from memory by passing
cert
andkey
as byte arrays instead of file paths. noWaitAfter
in locator.selectOption() was deprecated.- We've seen reports of WebGL in Webkit misbehaving on GitHub Actions
macos-13
. We recommend upgrading GitHub Actions tomacos-14
.
- Chromium 129.0.6668.29
- Mozilla Firefox 130.0
- WebKit 18.0
This version was also tested against the following stable channels:
- Google Chrome 128
- Microsoft Edge 128
v1.46.0
Playwright now allows to supply client-side certificates, so that server can verify them, as specified by TLS Client Authentication.
You can provide client certificates as a parameter of browser.newContext() and apiRequest.newContext(). The following snippet sets up a client certificate for https://example.com
:
BrowserContext context = browser.newContext(new Browser.NewContextOptions()
.setClientCertificates(asList(new ClientCertificate("https://example.com")
.setCertPath(Paths.get("client-certificates/cert.pem"))
.setKeyPath(Paths.get("client-certificates/key.pem")))));
- Content of text attachments is now rendered inline in the attachments pane.
- New setting to show/hide routing actions like route.resume().
- Request method and status are shown in the network details tab.
- New button to copy source file location to clipboard.
- Metadata pane now displays the
baseURL
.
- New
maxRetries
option in apiRequestContext.fetch() which retries on theECONNRESET
network error.
- Chromium 128.0.6613.18
- Mozilla Firefox 128.0
- WebKit 18.0
This version was also tested against the following stable channels:
- Google Chrome 127
- Microsoft Edge 127
v1.45.1
https://github.com/microsoft/playwright-java/issues/1617 - [Bug]: Traceviewer not reporting all actions https://github.com/microsoft/playwright/issues/31764 - [Bug]: some actions do not appear in the trace file
- Chromium 127.0.6533.5
- Mozilla Firefox 127.0
- WebKit 17.4
This version was also tested against the following stable channels:
- Google Chrome 126
- Microsoft Edge 126