# Playwright / Selenium

Browser tests you run. Playwright is Apache-2.0; Selenium is Apache-2.0 — BrowserStack without the parallel-session meter.

**Replaces:** BrowserStack

**Tier:** Easy

## Problem

BrowserStack sells real-device and browser-cloud sessions. You wanted the same tests on machines you control. Playwright is Apache-2.0 (microsoft/playwright). Selenium is Apache-2.0 (SeleniumHQ/selenium), including Grid if you need a farm. This is not every real iOS/Android device SKU, Safari on a Mac farm you do not own, or BrowserStack's visual-testing add-on. You still need browsers; you stop paying per parallel session.

## Stack

- [Playwright](https://playwright.dev) — Apache-2.0 browser test framework (Chromium, Firefox, WebKit)
- [Selenium](https://selenium.dev) — Apache-2.0 browser automation and Grid if you need a farm

## Estimated SaaS cost saved

| You stop paying | Typical / year | Self-host instead |
|---|---:|---|
| BrowserStack (small team) | $1,200 | Playwright and/or Selenium Grid |

**About $1,200 / year** on a small team, before you count lock-in.

## Deploy on Railway

These are CI jobs (and optionally a Selenium Grid). Playwright needs browser dependencies in the runner image. Grid is a set of nodes, not a single HTTP app. No one-click device-farm template in this repo — Start on Railway only if you also host Grid. Code quality stays on /stacks/sonarqube-lint.

[Start on Railway](https://c17.io/go/railway/playwright-browsers?from=%2Fstacks%2Fplaywright-browsers.md)

[SonarQube if this is static analysis, not browser tests](https://c17.io/stacks/sonarqube-lint)

## AGENT_PROMPT

```
Replace BrowserStack with Playwright (preferred) or Selenium Grid.

- Run Playwright in CI with the browsers the project already uses. Selenium Grid if you need a farm of nodes you operate.
- Port one smoke test. Do not claim every real-device SKU. Write AGENT_PROMPT.md.
```

## FAQ

### Playwright or Selenium?

Playwright if you want one API and bundled browsers. Selenium if you already have WebDriver tests or need Grid. Pick one runner on day one.

### Do I get real iPhones?

No. This is browsers you run. Real-device clouds are the product this page leaves.

### Can I deploy this on Railway?

The tests are CI. Grid can be a cluster of nodes. Railway is optional for Grid, not required for Playwright.

Source: https://c17.io/stacks/playwright-browsers
