Selenium vs Playwright — Architecture and learning path
Selenium and Playwright are two different automation tools/frameworks built for Web browser automation.
Selenium sends each command as a separate HTTP request and receives JSON responses. So every interaction, such as opening the browser, clicking an element, or sending keys in Selenium, is sent as a separate HTTP request.
Playwright communicates all requests through a single WebSocket connection, which stays in place until test execution is completed. This reduces the points of failure and allows commands to be sent quickly on a single connection.
In recent days many of the modern web projects based on Angular JS and React JS are utilizing the Playwright automation tool for their Automation projects.
Selenium is currently still have a major share of existing Automation projects, but Playwright is slowly getting more users and it will be good to have hands on practice and exposure on both Automation tools features.
If you are an beginner in Automation testing, then follow the below approach.
- Select one programming language (Java/ C# / Python/ JavaScript) and learn the basic concepts so that you can able to write some sample code. Continue to learn programming concepts.
- Start with Selenium, learn basics of Selenium WebDriver. Practice the topics and continue to learn the complex scenarios and try to automate them. Try to get familiar with atleast 10 to 20 important scenarios for Web automation. I will try to write another article on this topic.
- You can learn Playwright in this Step 3, become familiar with complex scenarios automation using Playwright and Selenium. It will help to compare the features of both tools. As Playwright supports API automation, you can explore that area as well.
As there are currently not enough projects on Playwright, it is second preference, but plan to have both Automation tools for better opportunities and stand out in the crowded job market.
Focus more on Programming language and code logic building as an beginner, and automation tools will change if you change company or internal projects.
Don’t get attached to one popular Automation tools like Selenium, and atleast do some POC on newer tools like Playwright.
Best wishes!
Swaroop Nadella
Test Automation Engineer, Tech Educator
Subscribe here, to Get an email whenever I publish article on Medium
Core Java and Coding for Automation Testers — Udemy Course
Swaroop Nadella Academy Store — Quizzes and Courses