playwright vs puppeteer vs selenium-webdriver
웹 자동화 라이브러리
playwrightpuppeteerselenium-webdriver유사 패키지:

웹 자동화 라이브러리

웹 자동화 라이브러리는 웹 애플리케이션의 테스트 및 스크래핑을 자동화하는 도구입니다. 이 라이브러리들은 브라우저를 프로그래밍적으로 제어하여 사용자 인터페이스를 테스트하거나 데이터를 수집하는 데 사용됩니다. Playwright, Puppeteer, Selenium WebDriver는 각각의 특징과 장점을 가지고 있어 다양한 상황에서 유용하게 활용될 수 있습니다.

npm 다운로드 트렌드

3 년

GitHub Stars 순위

통계 세부사항

패키지
다운로드
Stars
크기
Issues
발행일
라이선스
playwright156,894,39599,1385.03 MB2920日前Apache-2.0
puppeteer15,563,36595,79243.2 kB21912日前Apache-2.0
selenium-webdriver2,155,02034,58523.7 MB1935日前Apache-2.0

기능 비교: playwright vs puppeteer vs selenium-webdriver

브라우저 지원

  • playwright:

    Playwright는 Chromium, Firefox, WebKit을 지원하여 다양한 브라우저에서 테스트를 수행할 수 있습니다. 이는 크로스 브라우저 테스트를 간편하게 만들어 줍니다.

  • puppeteer:

    Puppeteer는 주로 Chrome과 Chromium에 최적화되어 있습니다. Chrome의 최신 기능을 활용할 수 있지만, 다른 브라우저에 대한 지원은 제한적입니다.

  • selenium-webdriver:

    Selenium WebDriver는 Chrome, Firefox, Safari, Edge 등 다양한 브라우저를 지원합니다. 이는 다양한 환경에서의 테스트를 가능하게 합니다.

비동기 처리

  • playwright:

    Playwright는 비동기 API를 제공하여 테스트 실행 중에 발생하는 여러 작업을 효율적으로 처리할 수 있습니다. 이는 테스트의 속도를 높이고, 복잡한 비동기 작업을 쉽게 관리할 수 있게 해줍니다.

  • puppeteer:

    Puppeteer는 Promise 기반의 API를 제공하여 비동기 작업을 처리합니다. 그러나 Playwright보다 비동기 처리에 대한 유연성이 떨어질 수 있습니다.

  • selenium-webdriver:

    Selenium WebDriver는 비동기 처리를 지원하지만, Playwright와 Puppeteer에 비해 상대적으로 복잡한 설정이 필요할 수 있습니다.

설치 및 설정

  • playwright:

    Playwright는 설치가 간편하고, 기본적으로 필요한 브라우저를 자동으로 다운로드합니다. 이는 초기 설정을 간소화하여 빠르게 시작할 수 있게 해줍니다.

  • puppeteer:

    Puppeteer도 설치가 간단하며, Chrome과 함께 제공되는 패키지로 쉽게 사용할 수 있습니다. 그러나 특정 버전의 Chrome에 의존할 수 있습니다.

  • selenium-webdriver:

    Selenium WebDriver는 다양한 언어와 플랫폼에서 사용할 수 있지만, 설정이 다소 복잡할 수 있으며, 각 브라우저에 맞는 드라이버를 별도로 설치해야 합니다.

테스트 속도

  • playwright:

    Playwright는 멀티 브라우저 테스트를 지원하며, 비동기 처리를 통해 빠른 테스트 속도를 제공합니다. 이는 대규모 테스트 환경에서 유리합니다.

  • puppeteer:

    Puppeteer는 Chrome에 최적화되어 있어 빠른 테스트 속도를 자랑합니다. 그러나 다른 브라우저에 대한 테스트는 느릴 수 있습니다.

  • selenium-webdriver:

    Selenium WebDriver는 다양한 브라우저를 지원하지만, 각 브라우저 간의 성능 차이로 인해 테스트 속도가 느릴 수 있습니다.

커뮤니티 및 지원

  • playwright:

    Playwright는 비교적 새로운 라이브러리이지만, 활발한 커뮤니티와 문서가 제공되어 사용자가 쉽게 접근할 수 있습니다.

  • puppeteer:

    Puppeteer는 Google에서 개발하여 강력한 커뮤니티 지원을 받고 있으며, 다양한 예제와 문서가 존재합니다.

  • selenium-webdriver:

    Selenium WebDriver는 오랜 역사를 가진 라이브러리로, 방대한 커뮤니티와 자료가 존재하여 문제 해결이 용이합니다.

선택 방법: playwright vs puppeteer vs selenium-webdriver

  • playwright:

    Playwright는 여러 브라우저를 지원하고, 크로스 브라우저 테스트를 쉽게 수행할 수 있습니다. 최신 웹 기능을 지원하며, 비동기 작업을 효율적으로 처리할 수 있는 기능이 필요하다면 Playwright를 선택하세요.

  • puppeteer:

    Puppeteer는 Chrome 전용으로 설계되어 있으며, Chrome의 최신 기능을 활용한 테스트가 필요할 때 유용합니다. 간단한 스크래핑이나 테스트를 원한다면 Puppeteer가 적합합니다.

  • selenium-webdriver:

    Selenium WebDriver는 다양한 브라우저와 플랫폼을 지원하며, 대규모 테스트 환경에서의 호환성이 중요할 때 선택해야 합니다. 여러 언어로 API를 제공하므로 다양한 개발 환경에서 사용 가능합니다.

playwright의 README

🎭 Playwright

npm version Chromium version Firefox version WebKit version Join Discord

Documentation | API reference

Playwright is a framework for web automation and testing. It drives Chromium, Firefox, and WebKit with a single API — in your tests, in your scripts, and as a tool for AI agents.

Get Started

Choose the path that fits your workflow:

Best forInstall
Playwright TestEnd-to-end testingnpm init playwright@latest
Playwright CLICoding agents (Claude Code, Copilot)npm i -g @playwright/cli@latest
Playwright MCPAI agents and LLM-driven automationnpx @playwright/mcp@latest
Playwright LibraryBrowser automation scriptsnpm i playwright
VS Code ExtensionTest authoring and debugging in VS CodeInstall from Marketplace

Playwright Test

Playwright Test is a full-featured test runner built for end-to-end testing. It runs tests across Chromium, Firefox, and WebKit with full browser isolation, auto-waiting, and web-first assertions.

Install

npm init playwright@latest

Or add manually:

npm i -D @playwright/test
npx playwright install

Write a test

import { test, expect } from '@playwright/test';

test('has title', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  await expect(page).toHaveTitle(/Playwright/);
});

test('get started link', async ({ page }) => {
  await page.goto('https://playwright.dev/');
  await page.getByRole('link', { name: 'Get started' }).click();
  await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();
});

Run tests

npx playwright test

Tests run in parallel across all configured browsers, in headless mode by default. Each test gets a fresh browser context — full isolation with near-zero overhead.

Key capabilities

Auto-wait and web-first assertions. No artificial timeouts. Playwright waits for elements to be actionable, and assertions automatically retry until conditions are met.

Locators. Find elements with resilient locators that mirror how users see the page:

page.getByRole('button', { name: 'Submit' })
page.getByLabel('Email')
page.getByPlaceholder('Search...')
page.getByTestId('login-form')

Test isolation. Each test runs in its own browser context — equivalent to a fresh browser profile. Save authentication state once and reuse it across tests:

// Save state after login
await page.context().storageState({ path: 'auth.json' });

// Reuse in other tests
test.use({ storageState: 'auth.json' });

Tracing. Capture execution traces, screenshots, and videos on failure. Inspect every action, DOM snapshot, network request, and console message in the Trace Viewer:

// playwright.config.ts
export default defineConfig({
  use: {
    trace: 'on-first-retry',
  },
});
npx playwright show-trace trace.zip

Parallelism. Tests run in parallel by default across all configured browsers.

Full testing documentation


Playwright CLI

Playwright CLI is a command-line interface for browser automation designed for coding agents. It's more token-efficient than MCP — commands avoid loading large tool schemas and accessibility trees into the model context.

Install

npm install -g @playwright/cli@latest

Optionally install skills for richer agent integration:

playwright-cli install --skills

Usage

Point your coding agent at a task:

Test the "add todo" flow on https://demo.playwright.dev/todomvc using playwright-cli.
Take screenshots for all successful and failing scenarios.

Or run commands directly:

playwright-cli open https://demo.playwright.dev/todomvc/ --headed
playwright-cli type "Buy groceries"
playwright-cli press Enter
playwright-cli screenshot

Session monitoring

Use playwright-cli show to open a visual dashboard with live screencast previews of all running browser sessions. Click any session to zoom in and take remote control.

playwright-cli show

Full CLI documentation | GitHub


Playwright MCP

The Playwright MCP server gives AI agents full browser control through the Model Context Protocol. Agents interact with pages using structured accessibility snapshots — no vision models or screenshots required.

Setup

Add to your MCP client (VS Code, Cursor, Claude Desktop, Windsurf, etc.):

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest"]
    }
  }
}

One-click install for VS Code:

Install in VS Code

For Claude Code:

claude mcp add playwright npx @playwright/mcp@latest

How it works

Ask your AI assistant to interact with any web page:

Navigate to https://demo.playwright.dev/todomvc and add a few todo items.

The agent sees the page as a structured accessibility tree:

- heading "todos" [level=1]
- textbox "What needs to be done?" [ref=e5]
- listitem:
  - checkbox "Toggle Todo" [ref=e10]
  - text: "Buy groceries"

It uses element refs like e5 and e10 to click, type, and interact — deterministically and without visual ambiguity. Tools cover navigation, form filling, screenshots, network mocking, storage management, and more.

Full MCP documentation | GitHub


Playwright Library

Use playwright as a library for browser automation scripts — web scraping, PDF generation, screenshot capture, and any workflow that needs programmatic browser control without a test runner.

Install

npm i playwright

Examples

Take a screenshot:

import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://playwright.dev/');
await page.screenshot({ path: 'screenshot.png' });
await browser.close();

Generate a PDF:

import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://playwright.dev/');
await page.pdf({ path: 'page.pdf', format: 'A4' });
await browser.close();

Emulate a mobile device:

import { chromium, devices } from 'playwright';

const browser = await chromium.launch();
const context = await browser.newContext(devices['iPhone 15']);
const page = await context.newPage();
await page.goto('https://playwright.dev/');
await page.screenshot({ path: 'mobile.png' });
await browser.close();

Intercept network requests:

import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage();
await page.route('**/*.{png,jpg,jpeg}', route => route.abort());
await page.goto('https://playwright.dev/');
await browser.close();

Library documentation | API reference


VS Code Extension

The Playwright VS Code extension brings test running, debugging, and code generation directly into your editor.

Run and debug tests from the editor with a single click. Set breakpoints, inspect variables, and step through test execution with a live browser view.

Generate tests with CodeGen. Click "Record new" to open a browser — navigate and interact with your app while Playwright writes the test code for you.

Pick locators. Hover over any element in the browser to see the best available locator, then click to copy it to your clipboard.

Trace Viewer integration. Enable "Show Trace Viewer" in the sidebar to get a full execution trace after each test run — DOM snapshots, network requests, console logs, and screenshots at every step.

Install the extension | VS Code guide


Cross-Browser Support

LinuxmacOSWindows
Chromium1 156.0.8078.4:white_check_mark::white_check_mark::white_check_mark:
WebKit 27.2:white_check_mark::white_check_mark::white_check_mark:
Firefox 157.0:white_check_mark::white_check_mark::white_check_mark:

Headless and headed execution on all platforms. 1 Uses Chrome for Testing by default.

Other Languages

Playwright is also available for Python, .NET, and Java.

Resources