Releases: microsoft/playwright-dotnet
v1.15.4
Highlights
This patch includes bug fixes for the following issues:
microsoft/playwright#9261 - [BUG] npm init playwright fails on path spaces
microsoft/playwright#9298 - [Question]: Should new Headers methods work in RouteAsync ?
Browser Versions
- Chromium 96.0.4641.0
- Mozilla Firefox 92.0
- WebKit 15.0
This version of Playwright was also tested against the following stable channels:
- Google Chrome 93
- Microsoft Edge 93
(driver version: 1.15.2-1633455481000
)
v1.15.2
Highlights
This patch includes bug fixes for the following issues:
microsoft/playwright#9065 - [BUG] browser(webkit): disable COOP support
microsoft/playwright#9092 - [BUG] browser(webkit): fix text padding
Browser Versions
- Chromium 96.0.4641.0
- Mozilla Firefox 92.0
- WebKit 15.0
This version of Playwright was also tested against the following stable channels:
- Google Chrome 93
- Microsoft Edge 93
(driver version: 1.15.0-1633020276000
)
v1.15.1
Highlights
This patch includes bug fixes for the following issues:
microsoft/playwright#8955 - [BUG] fix(inspector): stop on all snapshottable actions
microsoft/playwright#8999 - [BUG] fix: do not dedup header values
microsoft/playwright#9038 - [BUG] fix: restore support for slowmo connect option
Browser Versions
- Chromium 96.0.4641.0
- Mozilla Firefox 92.0
- WebKit 15.0
This version of Playwright was also tested against the following stable channels:
- Google Chrome 93
- Microsoft Edge 93
v1.15.0
🖱️ Mouse Wheel
By using Page.Mouse.WheelAsync
you are now able to scroll vertically or horizontally.
📜 New Headers API
Previously it was not possible to get multiple header values of a response. This is now possible and additional helper functions are available:
- Request.AllHeadersAsync()
- Request.HeadersArrayAsync()
- Request.HeaderValueAsync(name: string)
- Response.AllHeadersAsync()
- Response.HeadersArrayAsync()
- Response.HeaderValueAsync(name: string)
- Response.HeaderValuesAsync(name: string)
🌈 Forced-Colors emulation
Its now possible to emulate the forced-colors
CSS media feature by passing it in the context options or calling Page.EmulateMediaAsync().
New APIs
- Page.RouteAsync() accepts new
times
option to specify how many times this route should be matched. - Page.SetCheckedAsync(selector: string, checked: Boolean) and Locator.SetCheckedAsync(selector: string, checked: Boolean) was introduced to set the checked state of a checkbox.
- Request.SizesAsync() Returns resource size information for given http request.
- Tracing.StartChunkAsync() - Start a new trace chunk.
- Tracing.StopChunkAsync() - Stops a new trace chunk.
Browser Versions
- Chromium 96.0.4641.0
- Mozilla Firefox 92.0
- WebKit 15.0
Important ⚠
- ⬆ .NET Core Apps 2.1 are no longer supported for our CLI tooling. As of August 31st, 2021, .NET Core 2.1 is no longer supported and will not receive any security updates. We've decided to move the CLI forward and require .NET Core 3.1 as a minimum.
This version of Playwright was also tested against the following stable channels:
- Google Chrome 93
- Microsoft Edge 93
Important ⚠
- ⬆ .NET Core Apps 2.1 are no longer supported for our CLI tooling. As of August 31st, 2021, .NET Core 2.1 is no longer supported and will not receive any security updates. We've decided to move the CLI forward and require .NET Core 3.1 as a minimum.
v1.14.1
Highlights
This patch includes bug fixes for the following issues:
microsoft/playwright#8287 - [BUG] webkit crashes intermittently: "file data stream has an unexpected number of bytes"
microsoft/playwright#8281 - [BUG] HTML report crashes if diff snapshot does not exists
microsoft/playwright#8230 - Using React Selectors with multiple React trees
microsoft/playwright#8366 - [BUG] Mark timeout in isVisible as deprecated and noop
Browser Versions
- Chromium 94.0.4595.0
- Mozilla Firefox 91.0
- WebKit 15.0
This version of Playwright was also tested against the following stable channels:
- Google Chrome 92
- Microsoft Edge 92
v1.14.0
⚡️ New "strict" mode
Selector ambiguity is a common problem in automation testing. "strict" mode
ensures that your selector points to a single element and throws otherwise.
Pass Strict = true
into your action calls to opt in.
// This will throw if you have more than one button!
await page.ClickAsync("button", new () { Strict = true } );
📍 New Locators API
Locator represents a view to the element(s) on the page. It captures the logic sufficient to retrieve the element at any given moment.
The difference between the Locator and ElementHandle is that the latter points to a particular element, while Locator captures the logic of how to retrieve that element.
Also, locators are "strict" by default!
var locator = page.Locator("button");
await locator.ClickAsync();
Learn more in the documentation.
🧩 Experimental React and Vue selector engines
React and Vue selectors allow selecting elements by its component name and/or property values. The syntax is very similar to attribute selectors and supports all attribute selector operators.
await page.ClickAsync("_react=SubmitButton[enabled=true]");
await page.ClickAsync("_vue=submit-button[enabled=true]");
Learn more in the react selectors documentation and the vue selectors documentation.
✨ New nth
and visible
selector engines
nth
selector engine is equivalent to the:nth-match
pseudo class, but could be combined with other selector engines.visible
selector engine is equivalent to the:visible
pseudo class, but could be combined with other selector engines.
// select the first button among all buttons
await button.ClickAsync("button >> nth=0");
// or if you are using locators, you can use first(), nth() and last()
await page.Locator("button").First.ClickAsync();
// click a visible button
await button.ClickAsync("button >> visible=true");
.NET Specific Features
- 🧪
SkipAttribute
We now have aNUnit
attribute that can be used to skip various combinations of browser and/or platforms.
Browser Versions
- Chromium 94.0.4595.0
- Mozilla Firefox 91.0
- WebKit 15.0
This version of Playwright was also tested against the following stable channels:
- Google Chrome 92
- Microsoft Edge 92
v1.13.0
Playwright
- 🖖 Programmatic drag-and-drop support via the
Page.DragAndDropAsync()
API. - 🔎 Enhanced HAR with body sizes for requests and responses. Use via
RecordHarPath
option inBrowser.NewContextAsync()
. - 🔒 Assembly Signing for .NET assemblies is no longer done using
PublicSign
but using a full signing key, making it easier to use in projects requiring full-trust
Tools
- Playwright Trace Viewer now shows parameters, returned values and
console.log()
calls.
New and Overhauled Guides
Browser Versions
- Chromium 93.0.4576.0
- Mozilla Firefox 90.0
- WebKit 14.2
New Playwright APIs
- new
BaseURL
option inBrowser.NewContextAsync()
andBrowser.NewPageAsync()
Response.SecurityDetailsAsync()
andResponse.ServerAddrAsync()
Page.DragAndDropAsync()
andFrame.DragAndDropAsync()
Download.CancelAsync()
Page.InputValueAsync()
,Frame.InputValueAsync()
andElementHandle.InputValueAsync()
- new
Force
option inPage.FillAsync()
,Frame.FillAsync()
, andElementHandle.FillAsync()
- new
Force
option inPage.SelectOptionAsync()
,Frame.SelectOptionAsync()
, andElementHandle.SelectOptionAsync()
v1.12.2
Highlights
This patch release includes bugfixes for the following issues:
microsoft/playwright#7015 - [BUG] Firefox: strange undefined toJSON property on JS objects
microsoft/playwright#7048 - [BUG] Dialogs cannot be dismissed if tracing is on in Chromium or Webkit
microsoft/playwright#7058 - [BUG] Getting no video frame error for mobile chrome
Browser Versions
- Chromium 93.0.4530.0
- Mozilla Firefox 89.0
- WebKit 14.2
This version of Playwright was also tested against the following stable channels:
- Google Chrome 91
- Microsoft Edge 91
v1.12.1
Highlights
- Playwright for .NET v1.12 is now stable!
- The NuGet package has been renamed and is now available as Microsoft.Playwright.
- Ships with the codegen and trace viewer tools out-of-the-box
Browser Versions
- Chromium 93.0.4530.0
- Mozilla Firefox 89.0
- WebKit 14.2
This version of Playwright was also tested against the following stable channels:
- Google Chrome 91
- Microsoft Edge 91
Breaking Changes
This release is a major release for the .NET port. We've completely redone the API surface in order to ensure parity with the rest of the supported languages. Unfortunately, this meant we had to introduce some breaking changes. The following list points out the key ones:
- Installation of the browsers no longer happens automatically. Follow the steps in Getting started.
- Optional arguments have been replaced with an
options
class. Method calls should look closer to.LaunchAsync(new() { Headless = false });
- All
decimal
arguments are nowfloat
. IAccessibility
now returns aJSONElement
- The use of
System.Drawing.Point
was dropped in favour of using our own, generatedPosition
timeout
anddelay
arguments are nowfloat
.- The usage of the
Rect
class was replaced byElementHandleBoundingBoxResult
. WaitForState
was renamed toWaitForSelectorState
.SelectOption
was renamed toSelectOptionValue
.EventArg
s were removed in favor of the class theEventArg
was wrapping. For instancePage.Close
is now anEventHandler<IPage>
andPage.Download
is now anEventHandler<IDownload>
.Modifier
was renamed toKeyboardModifier
.LifecycleEvent
was renamed toLoadState
.- Arrays are now exposed as
ReadOnlyCollection
.
Other Breaking Changes
IBrowserContext
Events
New event: EventHandler<IRequest> Request
New event: EventHandler<IRequest> RequestFailed
New event: EventHandler<IRequest> RequestFinished
New event: EventHandler<IResponse> Response
Properties
DefaultTimeout
has been replaced withSetDefaultTimeout
DefaultNavigationTimeout
has been replaced withSetDefaultNavigationTimeout
Methods
GetCookiesAsync
has been replaced withCookiesAsync
GetStorageStateAsync
has been replaced withStorageStateAsync
SetHttpCredentialsAsync
has been removed.WaitForEventAsync
has been replaced withWaitForPageAsync
andRunAndWaitForPageAsync
.
IElementHandle
Methods
GetBoundingBoxAsync
has been replaced withBoundingBoxAsync
GetContentFrameAsync
has been replaced withContentFrameAsync
GetInnerHtmlAsync
has been replaced withInnerHTMLAsync
GetInnerTextAsync
has been replaced withInnerTextAsync
GetOwnerFrameAsync
has been replaced withOwnerFrameAsync
GetTextContentAsync
has been replaced withTextContentAsync
IFrame
Methods
GetContentAsync
has been replaced withContentAsync
GetFrameElementAsync
has been replaced withFrameElementAsync
GetInnerHtmlAsync
has been replaced withInnerHTMLAsync
GetInnerTextAsync
has been replaced withInnerTextAsync
GetTextContentAsync
has been replaced withTextContentAsync
GetTitleAsync
has been replaced withTitleAsync
GoToAsync
has been replaced withGotoAsync
IJSHandle
Methods
GetJsonValueAsync
has been replaced withJsonValueAsync
IPage
Events
Properties
DefaultTimeout
has been removed.DefaultNavigationTimeout
has been removed.Coverage
has been removed.
Methods
GetContentAsync
has been replaced withContentAsync
GetFrame
has been replaced withFrame
GetInnerHtmlAsync
has been replaced withInnerHTMLAsync
GetInnerTextAsync
has been replaced withInnerTextAsync
GetOpenerAsync
has been replaced withOpenerAsync
GetPdfAsync
has been replaced withPdfAsync
GetTextContentAsync
has been replaced withTextContentAsync
GetTitleAsync
has been replaced with TitleAsync``GoToAsync
has been replaced withGotoAsync
WaitForEventAsync
has been replaced with more specificWaitFor*
overloads
IRequest
Methods
GetPostDataJson
has been replaced withPostDataJSON
GetResponseAsync
has been replaced withResponseAsync
IResponse
Methods
GetBodyAsync
has been replaced withBodyAsync
GetJsonAsync
has been replaced withJsonAsync
GetTextAsync
has been replaced withTextAsync
IVideo
Methods
GetPathAsync
has been replaced withPathAsync
IWebSocket
Methods
WaitForEventAsync
has been removed.
Removed Types
ICoverage
has been removed.IConnectionTransport
has been removed.ICDPSession
has been removed.IChromiumBrowser
has been removed.IChromiumBrowserContext
has been removed.IChromiumBrowserType
has been removed.