๐งพ Locator code in Python
A locator from locator.normalize() now converts to a string as Python code. Use it with page.get_by_ref() to turn an element that an agent picks from a page.aria_snapshot() in the "ai" mode into code for your test:
normalized = page.get_by_ref("e2").normalize()
print(str(normalized))
# get_by_role("button", name="Submit")New APIs
- New option
timeoutin cdp_session.send().
Notable Fixes โ ๏ธ
-
Actions such as locator.click(), locator.check(), locator.tap(), locator.fill(), locator.clear() and locator.select_option() now wait for the element to be not inert. An action on an element with the
inertattribute, or inside such an element, now times out if the element stays inert. -
Cookie matching now follows RFC 6265. With a URL, browser_context.cookies() and api_request_context.cookies() no longer return host-only cookies for subdomains or
Path=/apicookies for/apiv2, and aPath=/foo/cookie does not match/foo. APIRequestContext sends a cookie without a name asCookie: xinstead ofCookie: =x, and storesSet-Cookie: tokenas a cookie without a name. -
Proxy credentials are no longer sent to websites. The credentials in the
proxyoption now answer only proxy challenges. To authenticate on a website, usehttp_credentials. -
Text that the browser does not render, such as text that is not assigned to a slot or text directly inside a closed
<details>, is no longer part of accessible names and aria snapshots. This can change the results of page.get_by_role() with a name, locator.aria_snapshot() and expect(locator).to_match_aria_snapshot(). -
String values of the
paramsoption in APIRequestContext requests are now appended to the query that the URL already has, instead of replacing it.
Announcements
- ๐ The Python client is now a line-by-line port of the Node.js client, so it behaves the same way. The API did not change. If you see a change in behavior, file an issue.
- ๐ฆ Playwright now publishes a source distribution next to the wheels. It does not include Node.js, so installs that do not accept wheels now work, such as
pip install --no-binary :all:and Poetry withinstaller.no-binary. An install from the source distribution uses a pre-installed Node.js that you set withPLAYWRIGHT_NODEJS_PATH. - ๐งฉ
pyeeis not a dependency anymore, so it no longer conflicts with packages that need a different version of it.
Browser Versions
- Chromium 158.0.8127.18
- Mozilla Firefox 159.0
- WebKit 27.2
This version was also tested against the following stable channels:
- Google Chrome 157
- Microsoft Edge 156