Release notes
Version 1.42
New Locator Handler
New method Page.AddLocatorHandlerAsync() registers a callback that will be invoked when specified element becomes visible and may block Playwright actions. The callback can get rid of the overlay. Here is an example that closes a cookie dialog when it appears.
// Setup the handler.
await Page.AddLocatorHandlerAsync(
Page.GetByRole(AriaRole.Heading, new() { Name = "Hej! You are in control of your cookies." }),
async () =>
{
await Page.GetByRole(AriaRole.Button, new() { Name = "Accept all" }).ClickAsync();
});
// Write the test as usual.
await Page.GotoAsync("https://www.ikea.com/");
await Page.GetByRole(AriaRole.Link, new() { Name = "Collection of blue and white" }).ClickAsync();
await Expect(Page.GetByRole(AriaRole.Heading, new() { Name = "Light and easy" })).ToBeVisibleAsync();
New APIs
- Page.PdfAsync() accepts two new options
tagged
andoutline
.
Announcements
- ⚠️ Ubuntu 18 is not supported anymore.
Browser Versions
- Chromium 121.0.6167.57
- Mozilla Firefox 121.0
- WebKit 17.4
This version was also tested against the following stable channels:
- Google Chrome 120
- Microsoft Edge 120
Version 1.41
New APIs
- New method Page.UnrouteAllAsync() removes all routes registered by Page.RouteAsync() and Page.RouteFromHARAsync(). Optionally allows to wait for ongoing routes to finish, or ignore any errors from them.
- New method BrowserContext.UnrouteAllAsync() removes all routes registered by BrowserContext.RouteAsync() and BrowserContext.RouteFromHARAsync(). Optionally allows to wait for ongoing routes to finish, or ignore any errors from them.
- New option
style
in Page.ScreenshotAsync() and Locator.ScreenshotAsync() to add custom CSS to the page before taking a screenshot.
Browser Versions
- Chromium 121.0.6167.57
- Mozilla Firefox 121.0
- WebKit 17.4
This version was also tested against the following stable channels:
- Google Chrome 120
- Microsoft Edge 120
Version 1.40
Test Generator Update
New tools to generate assertions:
- "Assert visibility" tool generates Expect(Locator).ToBeVisibleAsync().
- "Assert value" tool generates Expect(Locator).ToHaveValueAsync().
- "Assert text" tool generates Expect(Locator).ToContainTextAsync().
Here is an example of a generated test with assertions:
await Page.GotoAsync("https://playwright.dev/");
await Page.GetByRole(AriaRole.Link, new() { Name = "Get started" }).ClickAsync();
await Expect(Page.GetByLabel("Breadcrumbs").GetByRole(AriaRole.List)).ToContainTextAsync("Installation");
await Expect(Page.GetByLabel("Search")).ToBeVisibleAsync();
await Page.GetByLabel("Search").ClickAsync();
await Page.GetByPlaceholder("Search docs").FillAsync("locator");
await Expect(Page.GetByPlaceholder("Search docs")).ToHaveValueAsync("locator");
New APIs
- Option
reason
in Page.CloseAsync(), BrowserContext.CloseAsync() and Browser.CloseAsync(). Close reason is reported for all operations interrupted by the closure. - Option
firefoxUserPrefs
in BrowserType.LaunchPersistentContextAsync().
Other Changes
- Methods Download.PathAsync() and Download.CreateReadStreamAsync() throw an error for failed and cancelled downloads.
- Playwright docker image now comes with .NET 8 (new LTS).
Browser Versions
- Chromium 120.0.6099.28
- Mozilla Firefox 119.0
- WebKit 17.4
This version was also tested against the following stable channels:
- Google Chrome 119
- Microsoft Edge 119
Version 1.39
Evergreen browsers update.
Browser Versions
- Chromium 119.0.6045.9
- Mozilla Firefox 118.0.1
- WebKit 17.4
This version was also tested against the following stable channels:
- Google Chrome 118
- Microsoft Edge 118
Version 1.38
Trace Viewer Updates
- Zoom into time range.
- Network panel redesign.
New APIs
Deprecations
- The following methods were deprecated: Page.TypeAsync(), Frame.TypeAsync(), Locator.TypeAsync() and ElementHandle.TypeAsync(). Please use Locator.FillAsync() instead which is much faster. Use Locator.PressSequentiallyAsync() only if there is a special keyboard handling on the page, and you need to press keys one-by-one.
Browser Versions
- Chromium 117.0.5938.62
- Mozilla Firefox 117.0
- WebKit 17.0
This version was also tested against the following stable channels:
- Google Chrome 116
- Microsoft Edge 116
Version 1.37
📚 Debian 12 Bookworm Support
Playwright now supports Debian 12 Bookworm on both x86_64 and arm64 for Chromium, Firefox and WebKit. Let us know if you encounter any issues!
Linux support looks like this:
Ubuntu 20.04 | Ubuntu 22.04 | Debian 11 | Debian 12 | |
---|---|---|---|---|
Chromium | ✅ | ✅ | ✅ | ✅ |
WebKit | ✅ | ✅ | ✅ | ✅ |
Firefox | ✅ | ✅ | ✅ |