Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Microsoft Announces Playwright Alternative to Puppeteer

Microsoft Announces Playwright Alternative to Puppeteer

Playwright is an open-source Node.js library started by Microsoft for automating browsers based on Chromium, Firefox, and WebKit through a single API. The primary goal of Playwright is improving automated UI testing.

Playwright is similar in mission to Puppeteer, though Puppeteer only supports Chromium-based browsers. As explained by the Playwright team:

We are the same team that originally built Puppeteer at Google, but has since then moved on. Puppeteer proved that there is a lot of interest in the new generation of ever-green, capable, and reliable automation drivers. With Playwright, we'd like to take it one step further and offer the same functionality for all the popular rendering engines. We'd like to see Playwright vendor-neutral and shared governed.

The Playwright team strives to create more testing-friendly APIs by learning from lessons and challenges with Puppeteer.

Playwright also aims at being cloud-native through its BrowserContext abstraction, allowing BrowserContexts to either get created locally or provided as a service.

The Playwright team believes that due to the similarity of the core concepts and the APIs, migration between the Puppeteer and Playwright should be straightforward.

Playwright is also an alternative to WebDriver, the current W3C standard for web automation and testing. The Playwright team notes that Puppeteer influenced the WebDriver standard by steering WebDriver towards a bi-directional communication channel. The Playwright team hopes to shape future WebDriver standards to support numerous Progressive Web App (PWA) features, such as support for additional browser capabilities, more ergonomic APIs and increased testing reliability.

Playwright supports upstream versions of Chromium, and plans to synchronize their npm release cycle with the Chromium stable channel releases.

To support WebKit, Playwright makes modifications to WebCore and WebKit2 to extend WebKit's remote debugging capabilities and Playwright APIs. The team hopes to make these changes in WebKit to rely instead on the upstream version of WebKit.

For Firefox, Playwright also makes modifications to Firefox for features such as content script debugging, workers, CSP, emulation, network interception, and more. Similar to WebKit, the Playwright team hopes to land these changes in Firefox soon.

Playwright supports each browser engine across Windows, macOS, and Linux. Headless mode is available for all supported browsers and platforms.

Playwright is currently in a 0.9.x release, with a stable 1.0 version expected in 2020. Is Playwright Ready shares the current status of Playwright across the supported browser engines.

Playwright is open source software available under the Apache 2 license. Contributions are welcome via the Playwright contribution guidelines, following the Microsoft code of conduct.

Rate this Article