Playwright vs Selenium WebDriver Syntax Comparison by Example

Raw Selenium WebDriver with Ruby Binding is much better.

Zhimin Zhan
9 min readDec 25, 2022

--

A repost of my daughter’s article with permission. I added a few notes.

Update 2023–01–09: Playwright vs Selenium Speed Comparison

In my intern role early this year, I developed a set of automated test scripts. To be exact, 29 test cases, running reliably on a daily basis. My colleagues and managers were impressed.

I started with Selenium WebDriver with Rspec first. Later, I was told to use Playwright by the department’s test automation guru (of a large telecom company). As a 20-year-old fresh-out-of-Uni intern, of course, I listened. I did the Selenium Ruby version for new test scenarios first (much easier) and then converted it to Playwright. I also set up two build projects in the BuildWise CT server to run both versions daily.

This article will show the syntax difference between Playwright and Selenium, using a simple test case (login test) as an example.

· Comparison with a simple test case
·
Understand Automated Test Script Tiered Structure
·
While Real Test Automation is Hard, it is still achievable
·
Choose a Good Scripting Language
·
Zhimin’s Notes

--

--

Zhimin Zhan

Test automation & CT coach, author, speaker and award-winning software developer. Help teams succeed with Agile/DevOps by implementing real Continuous Testing.