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.