Playwright Python 1.61.0: WebStorage, WebAuthn, and Python 3.14 Support
Playwright Python version 1.61.0 has arrived with a significant set of features for modern web testing, including native access to WebStorage, virtual WebAuthn authenticators, and early support for the upcoming Python 3.14 release. This update also marks the end of support for Python 3.9 and introduces Docker images for Ubuntu 26.04.
The latest release of Playwright for Python continues to close the gap between the core library and the specific needs of Python developers. By rolling to version 1.61.0 of the underlying driver, the library brings updated browser engines: Chromium 149.0.7827.55, WebKit 26.5, and Firefox 151.0. Beyond the browser bumps, the introduction of the WebStorage API and virtual authenticators for WebAuthn simplifies several complex testing scenarios that previously required manual execution of JavaScript or external libraries.
Native Access to WebStorage
One of the most useful additions in this release is the WebStorage class. Previously, if you wanted to inspect or modify localStorage or sessionStorage, you had to use page.evaluate() to run JavaScript within the browser context. While this worked, it felt disconnected from the rest of the Pythonic API and lacked type safety.
The new page.local_storage and page.session_storage properties provide a direct way to interact with these storage mechanisms. You can now get items, set items, remove them, or clear the entire storage using standard method calls. This is particularly helpful for setting up test state, such as authentication tokens or user preferences, without navigating through the entire UI.
# Setting an item in local storage directly
page.local_storage.set_item("theme", "dark")
# Retrieving all items as a list of name/value pairs
items = page.local_storage.items()
for item in items:
print(f"{item['name']}: {item['value']}")
# Clearing session storage
page.session_storage.clear()
This change makes tests more readable and less dependent on string based JavaScript snippets. The WebStorage implementation covers the standard storage methods like get_item, set_item, remove_item, and clear. It also includes an items() method that returns all entries at once, which is a common requirement for auditing or debugging test failures.
Virtual WebAuthn Authenticators
Testing passwordless authentication has always been a challenge for automated browser tests. WebAuthn relies on physical hardware or platform authenticators that are difficult to simulate in a CI environment. Playwright 1.61.0 addresses this by exposing Credentials through the browser context.
The new credentials API allows you to install a virtual authenticator into a BrowserContext. Once installed, you can seed it with credentials, intercept registration and authentication ceremonies, and even retrieve the public and private keys generated by the authenticator. This level of control is essential for end to end testing of passkey implementations.
Tests can now simulate a user registering a new passkey or authenticating with an existing one without any physical interaction. The context.credentials property provides methods to install(), create(), get(), and delete() credentials. This allows for fine grained control over the authenticator state throughout the lifecycle of a test.
Python and Ubuntu Lifecycle Updates
The project maintainers are keeping the library aligned with the broader Python ecosystem by dropping support for Python 3.9 and adding support for Python 3.14. Python 3.9 is approaching its end of life, and removing it allows the team to clean up legacy workarounds. For instance, a specific path resolution fix for Windows that was only needed for versions older than 3.10 has been removed from _browser_type.py.
Adding support for Python 3.14 this early ensures that developers who live on the edge can start testing their automation scripts against the next major Python release. The commit includes fixes for internal tests that were failing due to changes in how CPython handles interned strings in version 3.14.
On the infrastructure side, the team added support for Ubuntu 26.04 (Resolute Raccoon). This includes new Dockerfiles and build scripts to generate images based on the latest Ubuntu LTS. Supporting the newest Linux distributions is critical for teams running their tests in modern container environments or GitHub Actions runners.
Screencast and APIResponse Improvements
Several smaller but significant improvements landed in the core APIs. The screencast.start() method now accepts a size parameter, allowing you to specify the dimensions of the captured frames. This is useful for reducing the overhead of video recording or for ensuring that frames match a specific resolution requirement for analysis.
The on_frame callback for screencasts now receives a timestamp in the frame data. This helps in synchronizing captured frames with other events in the test log. Additionally, screencast.show_actions() now supports a cursor parameter to toggle between a pointer decoration and a hidden cursor, giving more control over how interactions are visualized in the recorded output.
For developers using Playwright for API testing, the APIResponse object has two new methods: security_details() and server_addr(). These provide access to SSL information and the remote IP address and port of the server. This is a welcome addition for tests that need to verify security certificates or ensure that requests are being routed to the correct server instances in a load balanced environment.
How to Prepare
If your project still relies on Python 3.9, you will need to upgrade to at least Python 3.10 before moving to Playwright 1.61.0. Most modern CI environments already provide newer Python versions, but it is worth checking your local development setup and your pyproject.toml constraints.
You should also review any tests that currently use page.evaluate() to interact with localStorage. Migrating these to the native page.local_storage API will make your code cleaner and more robust. The same applies to WebAuthn testing if you have been using complex workarounds or third party libraries.
Finally, keep an eye on the dependency bumps. This release includes updates to mypy, pytest, and setuptools. If you have strict version pinning or specific linting rules, these bumps might trigger new warnings or errors in your CI pipeline. Running a full test suite after upgrading is always recommended to ensure that the new browser engines and library changes do not introduce regressions in your specific application context.