r/QualityAssurance • • Jan 22 '25

Playwright vs Selenium 2025

They keep saying that Playwright is better than Selenium, but have you heard of SeleniumBase by Michael Mintz?

1 Upvotes

13 comments sorted by

24

u/Achillor22 Jan 22 '25

What does it have that's better than playwright? A quick look at it seems like it's just a wrapper for selenium that makes your code a little cleaner. 

1

u/Fit-Entrepreneur3272 Feb 26 '25

it is not just make selenium code little cleaner, it has a lot of automatic wait like pages, elements etc that playwright have

1

u/Achillor22 Feb 26 '25

Seems like you could just use Playwright then.

9

u/basecase_ Jan 22 '25

I think OP is Michael Mintz =P

2

u/SeleniumBase Feb 25 '25

The most popular difference today is that SeleniumBase has a special "CDP Mode" for bypassing CAPTCHAs and bot-detection services. Other frameworks don't have this ability.

-17

u/Fit-Entrepreneur3272 Jan 22 '25

SeleniumBase is for those who want to continue the legacy of Selenium WebDriver but with a simpler, higher-level abstraction that makes web automation and testing more efficient.

17

u/crappy_ninja Jan 22 '25

So basically what Achillor22 said.

8

u/Itchy_Extension6441 Jan 22 '25

The main advantage of Selenium nowadays is the amount of legacy projects and organizations who don't consider moving to different frameworks as an option. In my opinion, this wrapper is very poorly fit for that specific target audience.

  1. Plenty of corporations have non self hosted repos blocked via the company wide firewall.

  2. While it might make working easier for someone who is already familiar with it, for new hires who have prior experience with Selenium it might come as confusing and cause them to need extra time onboarding to get used to it.

  3. It's python only. While I'm in love with python and I use it pretty much for every private project, Python+Selenium is not the most popular pair for commercial projects (at least in Europe in my experience)

  4. It is currently actively maintained (last commit 2h ago), but that does not mean it will always be. Being a single person/private, non commercial project the risk of it getting abandoned is fairly higher than for Microsoft's Playwright.

5

u/[deleted] Jan 23 '25

Playwright is great for your standard web testing, it is easy to set up and simplifies loads of things that require heaps of boilerplate code in Selenium. However, as someone working on a highly specialized web product, I've realized that Selenium still has it's place, it is incredibly adaptable and robust.

9

u/basecase_ Jan 22 '25 edited Jan 22 '25

Most times you don't have a choice, and if you do 9/10 times you would pick the industry standard/modern tool (assuming you get to greenfield).

In today's climate for E2E testing Playwright is pretty much a no brainer if you have to pick since there really aren't a lot of options.

For example one company I was at was heavily invested into Selenium because that's all there was at the time and when other tools came out, we were already multiple years deep into robustifying Selenium/Webdriver and didn't see the need to switch over.

My last gig was for a startup that was only a couple years old and was a Node shop so it was also an easy choice (except our choice was between Cypress and Playwright and man I'm glad I picked the right horse)

There's obviously nuance like if you need heavy mobile testing then Playwright not be right for you.

But ya TLDR; you're probably using Selenium cuz you have to. What's "better" doesn't really matter when you have large test-suites and older codebases built on it

3

u/Sufficient_Wear1786 Jan 23 '25

100% agree. Now to be more marketable in the future I'd strongly recommend to practice on both. My project works heavily with Selenium however other side projects I had to use Cypress and I was damn glad I learned a bit how to use it.

Same with playwright. My projects don't need it but I will for sure start playing around with it.

2

u/basecase_ Jan 23 '25

good point, there really isn't a reason why someone who knows 1 couldn't pick up one of the others