Exploring Browser Automation Tools: My Favourites

March 19, 2024

Rick Schubert avatar
Rick Schubert
Software Engineer, Udemy Online Instructor. Excited about all things TypeScript/JavaScript, Go, Docker and Linux.

Over the years, a plethora of browser automation tools has emerged. A few of those stand out for their robustness, versatility, and popularity. Let’s delve into some of my favourite automation frameworks and understand what makes them shine.

Playwright: Leading the Pack

At the forefront of browser automation tools stands Playwright. Developed by Microsoft and written in JavaScript, Playwright has garnered significant attention, particularly for its ease of use and impressive feature set. I couldn’t live without fantastic options like built-in retries which make scripts very reliable. Then there’s the wonderfully easy and versatile selector mechanism, the extremely helpful live debugging and inspection mode, the great cross-browser support and an API that’s available in JavaScript/TypeScript, Python, Java and .NET. It’s no accident that Playwright boasts an impressive 60,000 GitHub stars, surpassing its counterparts with 45,000 for Cypress and 29,000 for Selenium.

If you’re interested in learning how to use Playwright, I’d recommend my online course with a review score of 4.7 from more than 3000 students. The course teaches the tool Playwright and all the necessary JavaScript knowledge, no prior experience required.

Cypress: Bridging the Gap

When it came out, Cypress had quickly risen in popularity and looked for a long time to be the new ruler of the kingdom, until Playwright came along and took that crown. Favoured for its modern approach and emphasis on component testing, Cypress offers a unique experience for automation enthusiasts that is particularly popular with front-end developers looking to implement something that can go deeper than unit tests. However, the journey of Cypress hasn’t been without hurdles, as delayed implementation of Firefox support led to a temporary loss of momentum. On top of that, its unconventional method of invoking assertions using string arguments

someElement.should("be.visible");

can present challenges, hindering IDE support and debugging capabilities. Despite this, Cypress remains a robust and popular tool.

Selenium: The Timeless Titan

Often regarded as the father, or even grandfather, of automation tools, Selenium remains a cornerstone in the field. Its influence extends to hosting major conferences, exemplified by SeleniumConf, which drew 300 attendees in Chicago 2023. Selenium’s crowning achievement lies in its creation of the WebDriver protocol, a standard followed by major browsers for enabling automation capabilities. This protocol ensures cross-browser compatibility, allowing Selenium scripts to execute seamlessly across various platforms. Additionally, Selenium IDE simplifies script creation for users with limited programming skills, making it accessible to a wide audience.

The emergence of newer tools like Playwright or Cypress has caused Selenium to drop in popularity, but it remains an important cornerstone in the automation landscape that’s still widely used, particularly in long-standing, more traditional companies.

WebdriverIO: A Modern Twist on Tradition

If Selenium is the grandfather, then WebdriverIO must be the grandson, inheriting the best traits of its predecessor while adding modern conveniences. Acting as a wrapper around the Selenium protocol, WebdriverIO offers a user-friendly API written in JavaScript. This abstraction simplifies automation tasks, making it an attractive option for developers seeking ease of use. With stable frameworks supporting Cucumber and BDD Gherkin scripts, WebdriverIO continues to gain traction in the automation community.

Conclusion: Navigating the Automation Landscape

If you had to choose just one automation framework to learn right now, then I would recommend Playwright due to its wide adoption, ease of use and rich feature set. (I have a course on the subject here.) But choosing a framework doesn’t have to be a “do or die” decision as many of the approaches are transferable from one to another. No matter which one you know, they will certainly help you land your next job, ideally found here on qajobs.co!