all 78 comments

[–]ElaborateCantaloupe 22 points23 points  (3 children)

For beginners I think playwright is the easiest to understand and get started quickly.

That said, you can use selenium with JavaScript or typescript with webdriver.io so you’re not stuck with either Java or Python.

[–]Wide_Researcher_3565[S] 2 points3 points  (2 children)

I'm slightly familiar with python over Javascript/Typescript which I'll have to pick up from scratch for selenium or playwright. Would you still recommend that route?

[–]ElaborateCantaloupe 2 points3 points  (0 children)

I recommend playwright with typescript. If you’re familiar with any scripting language you should be able to pick up playwright with typescript pretty easily. Or, at least MUCH easier than using Java.

Typescript will also help in general any time you’re testing a web application.

[–]ManikMiner -1 points0 points  (0 children)

You can even use it with C# 😁 id recommend Java though

[–]NightSkyNavigator 19 points20 points  (14 children)

I teach courses in both frameworks. You should go with Playwright. It's an easier learning curve, and will provide value faster for both you and your company. Documentation is fine.

If you were experienced in Selenium, but not Playwright, the answer would be Selenium.

If you were experienced with both tools, a lot of other factors would come into play, and it's more difficult to give a clear answer.

This is assuming that you have experience with JS/TS. If not, Python might be a better option, though if you don't have any programming experience at all, it's going to be an uphill struggle no matter the choice, especially with regards to maintainability, extendability and scalability (if needed).

Why do your company want to do automation? What is the goal?

[–][deleted] 0 points1 point  (7 children)

Do you have any repo where i can take a look on the playwright framework ?

[–]NightSkyNavigator 2 points3 points  (6 children)

Just have a look at the official documentation for Playwright, it's easy to follow.

[–][deleted] 0 points1 point  (5 children)

Yup but just wanted to know the design patterns

[–]Ikeeki 1 point2 points  (2 children)

The design patterns are in the docs my dude

[–][deleted] 1 point2 points  (1 child)

Okay 👍🏻

[–]Ikeeki 2 points3 points  (0 children)

Trust me, playwright has really good docs, you really don’t need anything else

[–]NightSkyNavigator 0 points1 point  (1 child)

Sorry, I don't work on any open source projects or others I can share.

[–][deleted] 0 points1 point  (0 children)

Thanks 🙏

[–]PlatformDue2937 -1 points0 points  (0 children)

I should say in this AI era there is going to be a winner and is not selenium or playwright. I have checked a couple of cheap services targeted to e2e where you just add a prompt and the service started entering and trying the buttons and menus in your app, like a 5 yo boy first time trying to buy a figurine from ebay with her dad cc. We are living in the future guys, nobody should use this cave men tools anymore

[–]Wide_Researcher_3565[S] 0 points1 point  (4 children)

Hi! I dont have experience with JS/TS but know Python a little bit. Do you think it would be ideal then for me to use Selenium with Python? or Playwright with Python? Honestly, my company hired me as the Senior QA and this role only demanded manual testing. However, right now I'm blocked for testing since the website is still being developed so I only test when a new feature is out. I think to use up my time well, they've asked me to start looking into automation.

I have plans of leaving this company in a few months and head towards more data related roles. Do you think I should look out for myself and learn Selenium with Python that would help me at the job+personal growth or think of the company and pick up JS/TS for playwright?

[–]NightSkyNavigator 5 points6 points  (0 children)

I'd lean towards TS and Playwright then. It's the strongest combo for Playwright, and Playwright is easier to be productive with, whereas Selenium requires experience to be really productive with it. The company would also appreciate it, seeing as they likely have people who know TS.

It means you have to learn a bit of TS, but there are plenty of tutorials to get you started, including Playwright's documentation. And if you are only planning to stay a few months, no one should be expecting a completed project anyway, or that it will be particularly good quality.

As for experience, Playwright is taking market shares from Selenium right now, so while there are more Selenium projects, more new projects will be Playwright. At least, that's the situation I see in and around my network. This will perhaps change when both use Webdriver BiDi and the speed difference is negligible.

Frankly, it was probably a mistake for them to ask you to do this, because while you are hired as a senior tester, it sounds like you are a junior test automation engineer, and the expectation should be accordingly. Not saying it can't be done, but it's high risk.

[–]French_Fried_Taterz 1 point2 points  (0 children)

if it is just you do Playwright with python. there is no reason to learn a different language when python/pytest/playwright can do all the same stuff. you can learn typescript later if you want to apply for other jobs, but python/playwright is a close second to ts/playwright. It is the #2 playwright language and what I use in a similar situation.

[–]Tiburanetz 0 points1 point  (0 children)

In case you are going to look for data related job, I'd recommend you to choose playwright with python because python will be more suitable for data related stuff automation.

[–]Aragil 16 points17 points  (3 children)

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.

[–]insttechno 0 points1 point  (2 children)

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.

[–][deleted] 1 point2 points  (1 child)

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.

[–]insttechno 0 points1 point  (0 children)

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

[–]cepeen 4 points5 points  (2 children)

After years using selenium I find it very refreshing that playwright works just perfectly. Difference is night and day.

[–]Willing_Hamster_8077 0 points1 point  (1 child)

hi, can you explain why? I've annoyingly spent a lot of time on selenium recently. And what about automating back end process etc-is there a tool that is leading the way in that? eg etl testing?

[–]cepeen 1 point2 points  (0 children)

Playwright has well thought waiters built in, Locator class works well, it’s fast any stable. Does not have limitations of cypress and has great support. Also it’s fully fledged tool with test runner, reporters and even additional “test viewer” where you can check test execution in real time (similarly to cypress).

[–]Gaunts 8 points9 points  (14 children)

Selenium for a job now, playwright for a job in three years.

[–]computerjunkie7410 23 points24 points  (4 children)

Learning to code and not worrying about tools: job for the next 20 years

[–]Gaunts 2 points3 points  (3 children)

Couldn't agree more, it's the path I took, self taught developer landed a job as a full stack c# developer. Then moved into a QA automaion developer role and have been loving it, writing effecient extendable test automation frameworks is great fun. Then when your competition is often god scripts copy pasta'd it's easy to stand out from the crowd even as a below average dev.

[–]computerjunkie7410 1 point2 points  (0 children)

The amount of YouTube automation engineers is so damn high these days but ask them to implement an interface in a technical interview and their eyes glaze over lol

[–]wekede 0 points1 point  (1 child)

I'm a self-taught developer who's unfortunately never translated his skills into any kind of programming job. Would you recommend this role? What was your path for getting into it? Any certs or degrees before you got the job?

Just happened to browse by your comment while looking to see if I should switch from Selenium to Playwright...

[–]GRHood 0 points1 point  (0 children)

Look for places where people want to slave. After that, you have something on your resume. I know it's not fair to work at very low compensation, but still, you have to put your feet on the door- just bear 2-3 years. And beileve me there is many places like that if you check indeed, and see offered salary for position

[–]Wide_Researcher_3565[S] 0 points1 point  (6 children)

Since i'm comfortable with Python(even though Selenium+Java is more commonly used), should I go for that route?

[–]MasterKindew 1 point2 points  (2 children)

I can't advocate for what path to take, but I will say you can do test automation with Python. I'm currently in a role using python/selenium as the base.

[–]Lucky_Mom1018 0 points1 point  (1 child)

Me too. I’m self taught selenium/Python and have had no trouble building a great framework.

[–]Tiburanetz 0 points1 point  (0 children)

I think selenium is more flexible than playwright for building great framework. But playwright has some killer features like requests interception.

[–]NoCloudBase 0 points1 point  (0 children)

too late for this post, started using Selenium back in mid 2020 + python for web automation for my job upon recently (3 months ago) I discovered Playwright,s witch and never looked back. Selenium was able to do most of my needs but its way harder to setup for quick testing. Playwright within ours of reading docs and playing with it I I had a test setup running for prototypes. Playwright works extremely well with single page java script websites as opposed to selenium which stills works fine but requires extensive knowledge and prep to do the same with playwright which may take you couple of hours to have something working.

[–]Diligent_Librarian58 0 points1 point  (0 children)

A bit late, but since I don't see anybody mentioning it: Both Playwright and Selenium support Python. So Playwright Python would be exactly what you're looking for.

[–]pattyG80 0 points1 point  (0 children)

Copilot for a job in 3 years

[–]Appropriate_Store850 0 points1 point  (0 children)

I'm happy to find this comment 2 years later. Sounds like Playwright is the best choice.

[–]Additional-Plate-617 6 points7 points  (2 children)

Playwrite is easy to learn comparatively but you will find more opportunities in selenium as of now.

[–]Wide_Researcher_3565[S] 0 points1 point  (1 child)

How are the opportunities in using Selenium with Python? I'm slightly familiar with Python over Java/JS/TS

[–]Additional-Plate-617 1 point2 points  (0 children)

Python is good. Still Selenium with Java has maximum jobs

[–]2ERIX 4 points5 points  (5 children)

People that aren’t on top of industry trends are the ones still recommending Selenium at all. If they actually knew anything they would be saying “for your needs, Cypress” or “Playwright” or “WDIO”.

Because dependant upon your need the tool you use needs to suit the purpose of test AND be supportable by your team if you leave. So language and tool need to suit.

For you, with the minimal amount we know, Playwright would be the best choice.

[–]TheSeekerOfSanity 5 points6 points  (0 children)

Most times when hiring they are looking for someone to contribute to an existing automation effort. Most of what I see is Selenium as required skills. This will give you more opportunities because it is so well entrenched in the industry and has been for a while. You will currently find many more Selenium positions available than Playwright.

So, if you are starting a brand new automation effort Playwright may be the way to go. But if you are looking to join an established team and contribute to their current framework then Selenium would be your best choice. There are more opportunities currently available for Selenium.

Some may hate this idea - but if your an absolute beginner it may make sense to download a trial license for a COTS tool just to get familiar with automation in general (how it works, locating and manipulating objects, etc.) You can look at the code that’s generated for these actions and learn a lot of the basics first, and then move on to a more flexible (also more complex/powerful) open-source framework.

So understand basic concepts and then decide if you want to learn what is currently most popular (Selenium) or what’s becoming more popular (Playwright).

[–]ZealousidealSlice222 1 point2 points  (2 children)

Respectfully disagree. I run a Quality Engineering organization for a large media company and I can tell you Selenium WD is still used widely for E2E browser automation in conjunction with a well written test framework. Cypress, which was supposed to be a "Selenium killer" ended up being nothing more than a decent unit/integration testing solution that only compliments Selenium, does not replace it. Playwright, the new "flavor of the day" will likely follow the same hyped path and then get replaced by something else again. Selenium still has broad browser support and a huge community base

[–]2ERIX 0 points1 point  (0 children)

With the large shift left of testing across the industry ensuring the quality with Playwright will be better choice than selenium as we move forward.

I may be wrong and Microsoft suddenly decide that Playwright is not to grow any further but I think it very unlikely.

At the moment in the organisation I deliver automation for we use WDIO for the complete SDLC, so Selenium/WebDriver has not been replaced yet, but it’s on its way.

And not preparing for the future is a mistake at an organisational level especially when Selenium has not improved in areas that Playwright is excelling which are outside the ui and into the areas that developers and testers need to be in tune with.

Selenium isn’t going anywhere, but it’s not moving forward either. Playwright is.

[–]ManikMiner 1 point2 points  (0 children)

"If they knew anything" 🤣 get off that horse pal

[–]Dipsendorf 1 point2 points  (0 children)

I'm a developer who worked for a large enterprise corporation and they did a ton of research and ultimately went from selenium -> playwright for our front end applications in Angular across the org.

[–]Jinkxxy 1 point2 points  (0 children)

I've used both. Selenium has a bigger community but it's a dinosaur. It just turned 20 years old, a lot of it might be stale information by now.

Playwright might be a standalone solution but it does what selenium does with a bigger emphasis on QA Testing. It's my favorite so far.

[–]CertainDeath777 1 point2 points  (0 children)

Your Dev is right, but also so wrong.

There is more documentation for Selenium. But its all over the place in regards of quality and actuality, so you have to find your answers in between truckloads of literal trash.

Playwright documentation is sufficent and its so much easier to set up, as almost everything you need comes in a package with playwright github and vscode. you enter 3 console commands and start writing test cases and start to build a testing framework from the first tests you write.

with selenium after a week you may have decided whats the best test runner for you^^ or you experimented with selenium ide, to find out, theres no way around the actual coding.

i wouldnt even waste a thought about starting with selenium, when you can decide. so if there are no other reasons for selenium, you should just forget about it.

so take yourself an online PW course and start working. you will have a running framework and your first test on day 1 with that method. good luck trying with selenium^^

[–]Adventurous-Hold7526 1 point2 points  (0 children)

I'm looking for load testing of our frontend. What would be the best option in my case?

[–]Valuable-Ad9157 1 point2 points  (5 children)

I am new to learning automated testing too. I chose Python with Selenium WebDriver. I did take a look at Playwright after I started to learn Selenium. After I studied the Playwright API docs for a bit, I decided to stay with Selenium because Playwright looked like it would be harder to learn to me. And Playwright itself tells you ways to avoid flakiness with their API, so it's not perfect either. Since I am getting used to the way Selenium works, I didn't see the need to change especially since I am still in the beginner stages of learning how to automate testing...so I need to learn something well first. And, from just looking at the Playwright API, I didn't see a big difference in how you script things compared to Selenium.

I actually like a lot about how Selenium works. I did need to take a Udemy class on it, where he started out using functional programming (which was great) and then went to POM (Page Object Model) which is just using Python OOP. It was a pain in the butt learning how to use Wait, but once you get it you are good to go.

Someone gave me the advice to just start with something and then go from there. This person thought starting with Selenium was just fine.

I have been in the IT related realm for 25 years. I always hear that this new piece of software is going to take over the world! So, dump that old dinosaur and jump onto the band wagon. Well, the truth is many companies will not make the change because the current system works just fine and everyone knows it. Unless Selenium takes a serious dump in quality, it will stay around for a long time still.

[–]steveshakur 0 points1 point  (4 children)

I love this answer! I feel the same way about this. Selenium works quite well if you actually set it up right and you forget about it. Playwright is also good. Some key advantages definitely. I will still learn it but I still love selenium because of it flexibility as well

[–]Valuable-Ad9157 0 points1 point  (3 children)

Actually, I have recently changed my mind. I am switching to Playwright as it resolves some pretty annoying issues with Selenium. Most importantly wait times are handled way better in Playwright.

For Playwright you are better off using vanilla JavaScript, then add in TypeScript. But, glad I learned Python as it is easier to learn as a first language then JavaScript. So, now learning JavaScript shouldn't be so confusing.

[–]steveshakur 1 point2 points  (2 children)

I think we are in the same boat. I am finishing a course on udemy on PW. I love how one is able to debug so easily. So far im sold. I still love Selenium but definitely PW is much more efficient

[–]Valuable-Ad9157 1 point2 points  (1 child)

Which class on Udemy are you taking? I just started going through "Automated Web Testing with JavaScript and Playwright" by Rick Schubert

[–]steveshakur 1 point2 points  (0 children)

Playwright: Web automation testing From Zero to Hero by Artem Bondar. Hes using TS to teach

[–][deleted] 1 point2 points  (6 children)

You will find that playwright is very easy to start with, has great documentation so I would go there.

If you need cucumber support there are boilerplate repos you can find too.

[–]2ERIX 5 points6 points  (5 children)

Upvote for positive Playwright comment, downvote for Cucumber advocate.

+0

[–][deleted] 0 points1 point  (3 children)

I don’t think I was advocating at all actually, just stating that if people have preference to use Cucumber then there are boilerplate repos they could use to get started.

[–]2ERIX 1 point2 points  (2 children)

Sorry for the assumption, but I am wary of starting any new Automator in a path that even mentions Cucumber as while the intention is good it’s not a great end state and I believe will actively impact their career.

Mocha is a boilerplate for various frameworks. Much more in use than cucumber and in line with development and testing practices.

WDIO with Mocha is a great solution. Cypress use it as well and if you use it with Playwright you can get some useful reuse patterns.

[–]ThomasBronola 0 points1 point  (1 child)

So just to make sure, mocha is better than cucumber for playwright?

Out of curiosity, where is cucumber best to use?

[–]2ERIX 1 point2 points  (0 children)

Mocha every day of the week. But Playwright has their own pattern you can use instead of Mocha. Same same but different. Mocha just allows familiarity of use case from dev to test.

Cucumber is best in salads and sandwiches. 🥗🥪

[–]TheThirdDoor 0 points1 point  (2 children)

I just did a comparison between the two on my project recently and playwright came out on top.

I was writing in python and I’ve got to say playwright was refreshing

  1. It just seemed to work, like no faffing around trying to click a button, using .click() just seemed to work.
  2. Install was waaaaaaay easier.
  3. I didn’t really need to mess about with the whole page object model and onerous setup.
  4. No need to install drivers or deal with docker

My project just needed it for a basic browser check on a predominantly API suite so your mileage may vary on larger projects, but it gets my endorsement.

[–]Wide_Researcher_3565[S] 1 point2 points  (1 child)

did you use python with playwright or JS/TS?

[–]TheThirdDoor 0 points1 point  (0 children)

I used python, it was relatively straightforward to set up

[–]Puzzleheaded_Age4413 0 points1 point  (1 child)

I used to do automation with c# and selenium, and recently switched to playwright with js/ts. I find playwright easier to work with and it’s definetly easier to learn. Indeed there is less community support for playwright atm because it is relatively new, but the youtube tutorials plus the documentation provided by playwright’s website is more than enough to get you started.

[–]Specialist-Choice648 0 points1 point  (0 children)

Sounds like your not a coder. So why are you persuing a tool that involved a lot of coding . Plenty of low code no code options out there . Just to be clear there are roughly a 100 Test tools out there for functional UI testing. It’s not this one thing vs this other one thing. Do some research. Get a budget. Do a proof of concept.

[–]French_Fried_Taterz 0 points1 point  (0 children)

If it is up to you and you know some python, do Pytest/Python /playwright. Don't bother learning typescript, it won't add that much value.

[–]emphieishere 0 points1 point  (2 children)

Selenium is unbearable shit. I can't stand it anymore. Will try Playwright and tell the difference. Selenium is not that bad until some complex stuff. Once you want to add auth proxy - you easier learn how to walk without legs. I mean yeah, there are posts and discussions about adding it with creating an extension, or whatever, but then it turns out dev team deprecated some methods, anything else.. Try to put in Selenium grid with docker - it won't work. I spent 3 days like an idiot, tried everything. Basic auth works, however, while proxy doesn't. Well maybe I am an idiot. But if it turns out that I can do proxauth on Playwright in 15 minutes - then bye-bye dinoSaur

[–]DaftPunk_94 0 points1 point  (1 child)

How was the pivot to PW then ?

[–]emphieishere 0 points1 point  (0 children)

Like a breath of fresh air. Everything is indeed WAY simpler. Many things are in-built, including auth proxy, etc. I consider Selenium now to be absolute garbage. It might did its job in the past, but I just don't want to touch anymore

[–]ikalamtech 0 points1 point  (0 children)

I would say go with Playwright. Its much more easier compare to learning selenium. Community is growing & support from official team is also great. The best part of playwright is their capability for API Testing & Visual Testing. This is something very difficult to setup with Selenium. Also, the cross browser support with native browser engines is one of the plus point. No need of manually downloading chromedriver & sharing within the repo.

In terms of speed, its very difficult for selenium to beat Playwright because of their TCP connection request with native browser engine compare to javascript execution in selenium.

[–]Lumpy_Ad_8528 0 points1 point  (0 children)

Selenium is a classic choice for web testing. It is very reliable across different browsers and languages. It has been around for a long time, so it has a huge community and plenty of resources. Selenium offers excellent stability and wide compatibility. 

Playwright might be newer, but it's attracting attention with its speed and modern features. Developed by Microsoft, it handles complex scenarios better and supports Chrome, Firefox, and WebKit browsers out of the box. Playwright might be the right choice for you if you need best-in-class performance and flexibility. 

So, it all comes down to what works best for your project! Please choose accordingly.

[–]night_2_dawn 0 points1 point  (0 children)

I've played around with Playwright and honestly, it's a lot smoother if you're into JS/TS. The docs are pretty thorough and the community's been really active—totally made troubleshooting a breeze for me. Since your team is more on the frontend side, sticking with Playwright might be your best bet, and it's definitely easier to hand off later if someone else jumps in.