Releases: microsoft/playwright-dotnet
v1.41.1
Highlights
- [REGRESSION] - ChromiumSandbox protocol mismatch (#2794 (comment))
- [REGRESSION] - Build with non-trailing slash output directory (#2827)
- [REGRESSION] - QuerySelectorAll on .NET 6 (#2830)
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
v1.41.0
New APIs
- New method page.UnrouteAllAsync() removes all routes registered by page.RouteAsync(url, handler) and page.RouteFromHARAsync(har). 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(url, handler) and browserContext.RouteFromHARAsync(har). 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
v1.40.0
Test Generator Update
New tools to generate assertions:
- "Assert visibility" tool generates Expect(locator).ToBeVisibleAsync([options]).
- "Assert value" tool generates Expect(locator).ToHaveValueAsync(value[, options]).
- "Assert text" tool generates Expect(locator).ToContainTextAsync(expected).
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([options]), BrowserContext.CloseAsync([options]) and Browser.CloseAsync([options]). Close reason is reported for all operations interrupted by the closure. - Option
FirefoxUserPrefs
in browserType.launchPersistentContext(userDataDir[, options]).
Other Changes
- Methods download.PathAsync() throw an error for failed and cancelled downloads.
- Playwright docker image now comes with .NET 8 (new LTS).
Potential breaking changes
When using Microsoft.Playwright.MSTest
or Microsoft.Playwright.NUnit
, Locale
and ColorScheme
were taken from the operating system as a default. After v1.40, its now aligned with Playwright for Node.js to en-US
and light
. In order to opt-in for the previous behaviour, the ContextOptions
method can be overidden.
using Microsoft.Playwright.NUnit;
namespace PlaywrightTests;
[Parallelizable(ParallelScope.Self)]
[TestFixture]
public class MyTest : PageTest
{
public override BrowserNewContextOptions ContextOptions()
{
return new BrowserNewContextOptions()
{
Locale = "en-GB",
ColorScheme = ColorScheme.Light,
};
}
}
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
v1.39.0
v1.38.0
Trace Viewer Updates
- Zoom into time range.
- Network panel redesign.
New APIs
Deprecations
- The following methods were deprecated:
Page.TypeAsync()
,Frame.TypeAsync()
,Locator.TypeAsync()
andElementHandle.TypeAsync()
.
Please useLocator.FillAsync()
instead which is much faster. UseLocator.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
v1.37.1
v1.37.0
📚 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 | ✅ | ✅ | ✅ | ✅ |
Browser Versions
- Chromium 116.0.5845.82
- Mozilla Firefox 115.0
- WebKit 17.0
This version was also tested against the following stable channels:
- Google Chrome 115
- Microsoft Edge 115
v1.36.0
v1.35.0
Highlights
-
New option
MaskColor
for methodsPage.screenshot()
andLocator.screenshot()
to change default masking color. -
New
uninstall
CLI command to uninstall browser binaries:$ pwsh bin/Debug/netX/playwright.ps1 uninstall # remove browsers installed by this installation $ pwsh bin/Debug/netX/playwright.ps1 uninstall --all # remove all ever-install Playwright browsers
Browser Versions
- Chromium 115.0.5790.13
- Mozilla Firefox 113.0
- WebKit 16.4
This version was also tested against the following stable channels:
- Google Chrome 114
- Microsoft Edge 114
v1.34.0
Highlights
-
New
Locator.And
to create a locator that matches both locators.var button = page.GetByRole(AriaRole.Button).And(page.GetByTitle("Subscribe"));
-
New events
BrowserContext.Console
andBrowserContext.Dialog
to subscribe to any dialogs
and console messages from any page from the given browser context. Use the new methodsConsoleMessage.Page
andDialog.Page
to pin-point event source.
Browser Versions
- Chromium 114.0.5735.26
- Mozilla Firefox 113.0
- WebKit 16.4
This version was also tested against the following stable channels:
- Google Chrome 113
- Microsoft Edge 113