Why Playwright

Why playwright is better than selenium webdriver, is it?

Written by

I have experience using both Selenium and Playwright. Here are some points why playwright is better than selenium. These points or based on playwright with Python programming language and my experience, so they could differ from person to person.

Where Playwright Excels

  • Playwright’s primary goal is to run automation without User Interface
  • Playwright(with and without UI) is faster than Selenium webdriver. Because Playwright itself is a browser.
  • You can use any locator without specifying what locator in the playwright
  • Playwright can listen to network calls without complexing the problem
  • The fixtures available for playwright makes opening and closing the browser much easier
  • Capturing video and tracing the test executions are unique built-in properties of the playwright
  • Playwright has inbuilt assertions, unlike selenium. Where selenium needs testNG assertions to verify.
  • Playwright is lightweight, compared with selenium
  • Few others points like having built-in browser, etc

Where selenium is better

  • Selenium has a bigger community to help
  • Performing certain tasks in Selenium is very straightforward. For example, retrieving CSS Value.

Author :

Senior Software Engineer in Test, with more than a decade of experience in automation tools like Selenium, Playwright, Protractor, and Puppeteer with Python, Java, and JS respectively.