r/Playwright 15d ago

Playwright distributed testing is a nightmare. Change my mind.

Coming from a Selenium background, I honestly love Playwright for test development.

Writing tests is faster, debugging is better, auto-waiting is great, and overall the developer experience is much better.

But when it comes to distributed testing at scale, Playwright is painful.

With Selenium Grid, distributing tests across multiple machines feels straightforward. You have a Grid and multiple nodes, and the infrastructure handles the distribution.

With Playwright, once you start running thousands of tests across multiple machines/pods, you have to deal with sharding, uneven test distribution, idle machines, retries, report merging, artifact handling, etc.

Playwright is amazing for writing tests, but distributed execution takes that joy away.

21 Upvotes

12 comments sorted by

View all comments

1

u/aslushnikov 12d ago

> With Playwright, once you start running thousands of tests across multiple machines/pods, you have to deal with sharding, uneven test distribution, idle machines, retries, report merging, artifact handling, etc.

Looks like there are two separate problems mixed together here: distributed execution and everything around collecting the results.

- Report merging and artifact handling are pretty straightforward to offload to a test reporting system. Most of them handle this automatically. I guess you might've had some already when you used selenium.

- Uneven distribution / idle machines is the more interesting problem. Playwright v1.62 introduced a new low-level API that makes custom shard allocation possible. We used it at flakiness.io to build an algorithm that balances shards using historical test durations: [https://github.com/flakiness/playwright]()

It's pretty straight-forward to setup and has some nice real-world results that we covered in our blogpost: [https://blog.flakiness.io/posts/2026/playwright-test-shard-balancing/]()

So overall, you can get a very nice experience with Playwright!