r/softwaretesting • • Mar 27 '24

Selenium VS Playwright

Hi, I'm a manual tester looking to start the automation testing effort for my company's website from scratch. From doing my research on this sub, I noticed that Playwright with JS/TS is the most recommended combo to learn and get started with. However, one of the devs in my team recommended that I start with Selenium because it's more common and has more documentation and community support. I'm confused now. I'm not particularly keen on learning Java for Selenium and Python with Selenium also doesnt sound appealing because the frontend is coded in JS/TS so I figured Playwright would be perfect.

Can someone tell me about their experience working with Playwright-JS/TS. How is the documentation and community support if i were to run into issues? Also, I might be leaving the company in a couple of months so I want to hand over the automation in a way that it can be picked up easily by the new guy.

56 Upvotes

78 comments sorted by

View all comments

16

u/Aragil Mar 27 '24

Selenium is not a test automation framework, it is a browser automation tool. You need to add at least a test runner, assertion library and reporting library in the mix, then orchestrate that properly to make something of it.
Playwright Test is a test automation framework, and it handles most of the complicated stuff like waiting, parallel runs, etc. out of the box (in addition to running the tests, doing reporting, and assertions).

If you start counting, Selenium will have more articles and videos, but most of them are old stuff, not actual anymore, or repeating the same 7-year old best practices. If we talk about working with the current versions of both tools, you will find Playwright to be way better supported.

1

u/insttechno Aug 30 '24

Ive been reading about this tool, is the idea of a test automation framework to test things like load? vs Selenium being more driven towards robotic process automation? Im also learning about it now.

2

u/[deleted] Oct 15 '24

Came across this comment looking for general opinions. My perspective as an engineer that writes tests for my software as part of my job:

Easiest way to think about it is selenium handles loading the browser, invoking operations and getting you to a testable state, then you use *another* tool to do whatever flavor of testing you want (e2e, unit, functional, et al). Playwright does the browser handling bit, the test running, results aggregation, etc and provides modern web-semantic support for testing as a complete framework so you don't need to cobble together quite as much duct tape and the result is effectively turn-key

____________________________

Aside:

From what I've seen surveying the space in the last few days, the only people still pushing Selenium are the people who don't want to invest time skilling-up to learn a new language or tool (typically java folks), or those who have a profit motive built up around it and are willing to go hard at the sunk-cost fallacy. It smacks of desperation.

That's not to say that playwright is without its rough edges, I've had PRs declined by Microsoft to make playwright more compatible with non-ubuntu linux distros, for example. We have a fair amount of custom patching built into our tool chain to support it in a redhat ecosystem. Overall though, it's where everything is headed and if you're windows or ubuntu-based, it's hard to beat.

1

u/insttechno Oct 15 '24

I actually rewrote my Selenium stuff in playwright and so far so good. Just found certain functions more easily achievable in playwright