# Playwright

> A tool that drives a real browser from code, to test a site like a user.

**Field:** Software Development  
**Category:** Testing & Quality  
**Also known as:** Playwright Test, Microsoft Playwright

## Think of it like

Think of it like a robot at the keyboard. It uses your website for you.

## Definition

Playwright is a tool that drives a real web browser from code. It is mostly used for end-to-end tests. Microsoft released it in 2020. One test can run in Chromium, Firefox and WebKit, the engine behind Safari. It waits for buttons and text to appear before it acts, which cuts down flaky tests. You can write tests in JavaScript, TypeScript, Python, Java or C#.

## Example

Jack's Playwright test opens his sign-up page in three browsers, fills the form and checks the welcome message. It catches a bug that only Safari had.

## Example code

```javascript
await page.goto('https://example.com');
await expect(page).toHaveTitle('Example Domain');
```

Open the page in a real browser and check its title.

## Why it matters

It tests the site the way people use it, in the browsers they really use.

## Common mistake

Adding fixed waits, like two seconds. Wait for the button to show up instead; it is faster and less flaky.

## Three principles

- **A real browser.** Driven from code.
- **Three engines.** Chromium, Firefox, WebKit.
- **Waits on its own.** Fewer flaky tests.

## Related terms

- [End-to-End Test (E2E)](https://learn.benibix.com/term/development/end-to-end-test)
- [Flaky Test](https://learn.benibix.com/term/development/flaky-test)
- [Test Runner](https://learn.benibix.com/term/development/test-runner)
- [Web Browser](https://learn.benibix.com/term/general/web-browser)
- [Browser Automation](https://learn.benibix.com/term/development/browser-automation)
- [Headless Browser](https://learn.benibix.com/term/development/headless-browser)
- [Cypress](https://learn.benibix.com/term/development/cypress)

## Told apart from

- [Playwright vs Cypress](https://learn.benibix.com/compare/playwright-vs-cypress): People think Playwright and Cypress are one tool with two names, and they are not. Cypress runs inside the browser, beside the app. Its tests are in JavaScript or TypeScript only. Playwright drives the browser from outside. It works in all three main browser engines, and it also takes Python, Java and .NET.
- [Selenium vs Playwright](https://learn.benibix.com/compare/selenium-vs-playwright): People think Selenium and Playwright are old and new names for one tool, and they are not. Selenium dates from 2004 and talks to each browser through the WebDriver standard, in languages such as Java, C# and Ruby. Playwright came out in 2020. It waits for each button to be ready by itself, so its tests tend to break less.

---

Source: https://learn.benibix.com/term/development/playwright
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
