Is Playwright based on Selenium?
No, Playwright is not based on Selenium. It does not use the WebDriver protocol. Its documentation describes driving its own builds of Chromium, Firefox, and WebKit, and it says Playwright does not work with branded Firefox or branded Safari because those builds rely on patches.
The clearest evidence is the one place the two meet. Playwright can connect to a Selenium Grid, but its own documentation calls that experimental, limits it to Google Chrome and Microsoft Edge, and explains that it depends on a Chrome DevTools Protocol connection that Selenium 4 exposes. If Selenium dropped that capability, the integration would stop working. A tool built on Selenium would not need that bridge.
The two also share no code you can port directly. Selenium tests call WebDriver commands through a language binding, and Playwright tests call Playwright's API, so a move from one to the other is a rewrite.
How do Selenium and Playwright differ in languages and browsers?
Selenium covers more languages and the real Safari browser, and Playwright covers WebKit, its own Firefox, and Chromium with a more uniform API across them.
Selenium's documentation lists language bindings for Java, Python, C#, Ruby, JavaScript, and Kotlin, and its browser guides cover Chrome, Edge, Firefox, Internet Explorer, and Safari. Because it follows the W3C standard, the same test can drive any browser whose vendor ships a WebDriver implementation, including Safari on a Mac.
Playwright supports JavaScript and TypeScript, Python, Java, and .NET. Only the Node.js version ships its own test runner. Python uses a pytest plugin, Java lets you pick JUnit or TestNG, and .NET provides base classes for MSTest, NUnit, and xUnit. Playwright's WebKit build stands in for Safari's engine, which covers most layout and behavior differences, but it is not the Safari app your customers run.
If your team writes Ruby or Kotlin, or your contract requires testing in Safari itself, that settles it for Selenium. If your team writes TypeScript, Python, Java, or C#, both are open to you.
Is Playwright easier than Selenium?
For most new suites, Playwright takes less setup because waiting, isolation, and a runner come built in, while Selenium leaves those choices to you. Here is the same sign-in test in both, in Python. Both passed against our demo app.
PYTHON
import os
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
def test_signs_in_with_valid_credentials():
options = webdriver.ChromeOptions()
options.add_argument("--headless=new")
driver = webdriver.Chrome(options=options)
try:
driver.get("http://localhost:3000/login")
driver.find_element(By.ID, "email").send_keys(os.environ["E2E_EMAIL"])
driver.find_element(By.ID, "password").send_keys(os.environ["E2E_PASSWORD"])
driver.find_element(By.CSS_SELECTOR, "button[type=submit]").click()
heading = WebDriverWait(driver, 10).until(
EC.visibility_of_element_located((By.TAG_NAME, "h1"))
)
assert heading.text == "Welcome back"
finally:
driver.quit()
PYTHON
import os
from playwright.sync_api import Page, expect
def test_signs_in_with_valid_credentials(page: Page):
page.goto("http://localhost:3000/login")
page.get_by_label("Email").fill(os.environ["E2E_EMAIL"])
page.get_by_label("Password").fill(os.environ["E2E_PASSWORD"])
page.get_by_role("button", name="Sign in").click()
expect(page.get_by_role("heading", name="Welcome back")).to_be_visible()
The Selenium version creates and closes the browser itself and waits explicitly for the heading. Selenium's own documentation calls synchronization perhaps the most common challenge in browser automation, sets the implicit wait to 0 by default, and warns not to mix implicit and explicit waits, because the timeouts can add up. The Playwright version gets a fresh page from the pytest plugin, and its web-first assertion retries until the heading appears.
Driver setup is easier than it used to be. Selenium Manager has shipped with every Selenium release since 4.6 and downloads a matching driver when none is available. In our run, the ChromeDriver already on the machine was older than the installed Chrome, and Selenium Manager fetched a matching one by itself. Its documentation still labels Selenium Manager as beta.
"Easier" also depends on who writes the tests. A Java team with years of Selenium page objects will move faster in Selenium than in a new tool, so weigh the team's existing code before the API.