DEV Community

Mangai Ram
Mangai Ram

Posted on

Will Playwright become next Selenium?

The Selenium initiative stands as an exceptionally triumphant venture in the realm of browser automation projects. Garnering downloads in the millions, Selenium reigns supreme globally, a testament to its enduring success.

Numerous factors contribute to Selenium's ascendancy:

Selenium, boasting open-source status, offers a multitude of language bindings such as Java, C#, Js, Python, Ruby, and Perl. It extends its reach across all major browsers (Chrome, Firefox, Edge, IE, Safari, Opera) and supports execution on diverse operating systems (Windows, MAC, Linux).

The versatility of Selenium shines through, allowing for comprehensive web testing, including cross-browser evaluations.

With a substantial user community, Selenium facilitates a swift initiation into its usage.

Selenium's stability sets it apart, exhibiting reliability surpassing other open-source tools. Its standardized W3C communication across browsers contributes to this stability.

The dynamic Selenium community fosters vibrancy through regular events and workshops, providing a platform for discussions on the latest tools and techniques among like-minded individuals.

Contemplating the trajectory of modern web application automation, Selenium WebDriver holds its ground as a favored tool. However, emerging alternatives like Playwright, Puppeteer, and Cypress threaten to reshape this landscape in the long run.

Playwright, a JavaScript framework supported by Microsoft, distinguishes itself in the UI automation domain. Leveraging Node.js for its backend, akin to Puppeteer, Playwright extends its framework to empower users in crafting end-to-end tests or isolating specific application segments.

Writing tests in language bindings such as Java, Js, C#, Python, and running seamlessly on any browser and OS, Playwright mirrors Selenium WebDriver's capabilities. Its open-source nature, user-friendly interface, and scalability for team collaboration make it an appealing prospect.

Seven compelling reasons position Playwright as a potential successor to Selenium in UI Automation:

Endorsed by Microsoft, Playwright benefits from knowledge sharing with the Puppeteer team. Multiple releases and positive community feedback underscore its promising trajectory.

Playwright streamlines automation with a simplified architecture, eliminating the complexities associated with native driver dependencies in Selenium WebDriver.

Boasting a 40% average increase in test execution speed, Playwright harnesses the power of JavaScript engines like Node.js, outperforming Selenium WebDriver.

Playwright distinguishes itself by offering video capturing of test executions in addition to full-page screenshots, a feature absent in Selenium WebDriver.

Playwright's reduced flakiness, support, and maintenance costs stem from internal waits, contrasting with Selenium WebDriver's reliance on explicit waits.

Adding to its allure, Playwright supports RESTful API testing alongside web testing, affording testers flexibility without delving into separate tools like Selenium WebDriver and RestAssured.

Playwright simplifies dev-tools integration, rendering the authoring of dev tests a straightforward endeavor.

In a visionary stance, TestLeaf/Qeagle anticipates Playwright's ascent as the next Selenium.

Their expertise aids organizations in seamlessly transitioning from Selenium WebDriver to Playwright, saving time, costs, and valuable resources.

Reference Article : https://medium.com/testleaftechblog/will-playwright-become-next-selenium-b41eebfa5d25

Top comments (1)

Collapse
 
evertones profile image
Everton Schneider

I've worked with Selenium for quite a long time and loved it. In fact, I still do.

At some point, I had to work on a POC with Cypress and Playwright, and both proved to be much faster.
However, besides the pros, and most of them pointed out well in the article, there are some things important to consider when talking about UI testing:

  • Cypress configuration for parallel testing without paying for the Could account is not as easy as Selenium Grid. There is no speed that would overcome the possibility to scale tests running them in parallel
  • Playwright runs parallel tests using Selenium Grid - except while implementing tests with Nodejs I believe, which is not officially supported. It means that parallel testing with Playwright depends on Selenium as well.

As mentioned already on issues on Github by Selenium contributors, Selenium is based on standards, different from Cypress and Playwright, which take advantage of V8 and the browser's DevTools. By saying that, Selenium implementation is based on features and specifications implemented by browsers, like the WebDriver and (now) the WebDriver BiDi.

There are always things to consider, but I think that if people look for reliability, Selenium is still a good choice, but now with the company of good competitors.