Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Playwright Test gets you from an empty JavaScript or TypeScript project to a working browser test: initialize the test runner, install the browser binaries it needs, write a test that checks an observable outcome, and run it. Tests run headlessly by default, and Playwright provides UI mode, reports, and optional VS Code integration for investigating failures.

What Playwright is—and what you need

Playwright Test is an end-to-end testing framework for modern web apps. It combines a test runner, assertions, per-test isolation, parallel execution, and developer tools. Its principal browser engines are Chromium, Firefox, and WebKit. You can run tests locally or in CI, in headless or headed mode; projects can also be configured for branded Chrome or Edge, or for mobile emulation.

Use the package manager already used by your JavaScript or TypeScript project. Playwright’s stable documentation is the right place to confirm requirements for your operating system and runtime: Playwright installation. Requirements can change between releases. The separate /docs/next/ documentation is explicitly for the Next version, so do not treat its listed runtime or OS requirements as stable-release requirements.

This guide assumes Node.js and a project directory in which you can install development dependencies. The CLI examples use npm; use the matching initializer and command runner if your project uses Yarn or pnpm.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Nicpro Mechanical Carpenter Pencils for Construction (Black, Red) With Case| Deep Hole Marker Pencil Set Includes Sharpener and 26 Refills, Comfortable Grip, Heavy Duty Woodworking Tools for Architect
  • Valued Carpenter Pencil Set: You will get 2 pcs solid carpenter pencils with 26 piece 2.8 mm refills, 1 replaceable sharpener, 1 plastic storage box.The complete carpenter pencils combination allows you to finish your work faster and more easily
  • Deep Hole Marker Pencil: The deep-hole construction pencils adopts 45mm elongated tip design, which is more convenient to mark in the small hole or in other tight areas that other carpenter markers cannot reach
  • Carpenter Pencils with Sharpener: The sharpener is screwed into the top of the work pencil, which won't get lost either. Built-in pencil sharpener that keep the lead with pointed and smooth to Improves line of sight in fine work
  • Stronger Solid Lead: This work pencil is matched with a 2.8 mm thick lead , which is much thicker and stronger during the drawing process of construction work, it will not break or damage easily
  • Marks on Various Surfaces: 3 colors solid construction pencil can marks on various surfaces,such as metal, plastic, wood, paper etc. Ideals for woodworkers, contractors, craftsmen, builders, merchants and masons

Initialize Playwright Test

  1. Open a terminal in your project directory (or the directory where you want to create the project).
  2. Run npm init playwright@latest. The initializer prompts you to choose JavaScript or TypeScript, a test directory, whether to add a GitHub Actions workflow, and whether to install browsers. The official guide also provides yarn create playwright and pnpm create playwright for those package managers.
  3. Review the generated playwright.config.ts, package manifest and lockfile, and example test. The configuration is where browser projects, timeouts, retries, and reporters are managed.
  4. If you skipped browser installation in the initializer, install the browsers required by your configured projects before running tests.

The initializer can be run later; the setup guide says it does not overwrite existing tests. Check its prompts and generated changes before committing them.

Install the browser binaries

Playwright versions expect browser binaries associated with that Playwright release. Install the browsers after setup, and repeat the install after a package update if Playwright reports that a browser is missing. The browser guide documents the commands and platform-specific options: Playwright browsers.

  • npx playwright install installs the default browser set used by the setup, generally Chromium, Firefox, and WebKit.
  • npx playwright install chromium installs Chromium alone when that is the only engine your project needs.
  • On Linux, if required system libraries are missing, use npx playwright install --with-deps to install browsers and dependencies, or npx playwright install-deps for dependencies.

Browser downloads use disk space and are cached in an OS-specific location by default. The browser guide documents listing and uninstalling browser installations, as well as shared or hermetic browser locations. Avoid relying on a fixed disk-size estimate: browser binaries change between releases.

Playwright browsers or branded Chrome and Edge?

Playwright’s bundled Chromium is not the same thing as the branded Google Chrome or Microsoft Edge installation. Those branded browsers are not installed by default; if you need to test a particular branded distribution, install or locate it and configure the corresponding browser channel in your project. For most tests, the default Playwright browser configuration is the simpler starting point.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
DEWALT 20V MAX Cordless Drill and Impact Driver, Power Tool Combo Kit , Includes 2 Batteries, Charger and Bag (DCK240C2)
  • Ergonomically Designed: Work in tight areas with a compact design that gets into tough spots
  • Compact and Lightweight: Both tools are designed to fit into difficult to reach spaces. The 1/4" impact driver has a length of 5.55 in. and weighs just 2.8 lbs, while the 1/2" drill/driver measures only 7.5 in. and weighs 3.6 lbs
  • Both the DEWALT impact driver and electric drill driver feature integrated LED work lights with a convenient 20-second delay, ensuring enhanced visibility in dimly lit or challenging work areas
  • One-Handed Loading - Keep one hand free with a 1/4 in. hex chuck that accepts 1 in. bit tips
  • Power drill cordless with 1/2" single sleeve ratcheting chuck provides tight bit gripping strength, making bit changes faster and more secure

Write a first test

A Playwright test uses the page fixture to interact with a page. Each test receives an isolated browser context, helping prevent one test’s browser state from leaking into another. Prefer locators that describe an element by its accessible role and name over positional selectors that depend on page layout. The following example follows the official first-test pattern; replace the example destination if needed for your project.

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

test('opens the documentation and follows a link', async ({ page }) => {
  await page.goto('https://playwright.dev/');

  await expect(page).toHaveTitle(/Playwright/);

  await page.getByRole('link', { name: 'Get started' }).click();
  await expect(
    page.getByRole('heading', { name: 'Installation' })
  ).toBeVisible();
});

Save it in the test directory selected during setup, for example tests/example.spec.ts. The example checks both the page title and the visible destination heading: launching a browser alone is not evidence that the behavior works.

Playwright waits for actionability before performing actions such as a click, and web-first assertions wait for the expected state. That is why this test does not add an arbitrary sleep. If an assertion fails, investigate whether the locator or expected page state is wrong before adding a wait. See Writing tests for locator and assertion guidance.

Run tests and choose a browser project

Run the suite from the project directory:

npx playwright test

The command runs configured tests headlessly by default and prints results in the terminal. The projects in playwright.config.ts determine which browser configurations run. To run one configured project, use its name from the configuration:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Push to Unlock,Katerk 6pcs 1/4 inch Hex Shank Aluminum Alloy Screwdriver Bit Holder Light-Weight Quick-Change Extension Bar Keychain Drill Screw Adapter Portable,Black Carabiner,Tool Gifts for Men
  • 【Great Compatibility】This Katerk 1/4 inch hex shank bit holder is specifically designed for 1/4 inch hex shank drill bits. It's compatible with most 1/4 fast hex handles, hex sockets, various electric screwdrivers, and handheld screwdrivers. The bit holder makes it a valuable addition for any handyman.
  • 【Secure and Safe】Built with a secure backup nut design, each drill bit holder securely locks onto your bits, ensuring they stay firmly in place. Additionally, our bit holder incorporates a high-quality steel ball rolling design that holds up to several kilograms of weight, ensuring your various drill bits don't fall off.
  • 【Easy One-Handed Operation】The bit holder for impact driver allows you to change bits single-handedly, simplifying your workflow. Its multi-color design further allows for quick identification of the drill bit you need.
  • 【Compact and Convenient】Thanks to its compact size, this 1/4 inch bit holder is easy to carry around. The bit holder allows for easy attachment to various tools, making this a convenient addition to your construction accessories. The Katerk bit holder is cast from high-quality alloy material, promising a long product lifespan. Despite its rugged strength, the bit holder remains lightweight, making it portable.
  • 【Cool Christmas Gift For Men Stocking Stuffers】 This screwdriver bit holder, driver bit holder, impact bit holder, can be given as a gift to your loved one, especially for anyone involved in construction or electrical work. It's a must-have for stocking stuffers for men and women, tools gifts for dad, tech gadgets for men, gifts for dad, gifts for him, gifts for husband, gifts for boyfriend, cool gadgets for men, and cool gifts for dad.
npx playwright test --project=chromium

Use npx playwright test --headed when you need to see the browser window during execution. Use npx playwright test --ui to open UI mode for interactive execution, step inspection, watch mode, locator picking, and trace integration. The available options and report commands are documented in Running and debugging tests.

Open the HTML report

When your configured reporter has produced an HTML report, open it with:

npx playwright show-report

The report gives you a way to inspect test results outside the initial terminal output. For an interactive view of execution and traces, use UI mode or the trace tools.

Debug a failure

  • Use UI mode when you want to step through a test, inspect its steps, or watch for changes as you work.
  • Use headed mode when seeing the browser interaction itself will clarify what happened.
  • Use traces to inspect the recorded execution and investigate where a test diverged from expectations.

These tools are optional: the command line is sufficient to start. For an editor workflow, the official Playwright VS Code extension adds Test Explorer integration, controls to run and debug individual tests, breakpoint debugging, a live browser, test recording, locator picking, and trace viewing. See Playwright for VS Code.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
2 Pack Carpenter Pencils Mechanical Pencils with 12 Refills, (2 Colors)
  • Long Nib and Deep Hole Marker: Our mechanical carpenter pencil with 45mm nib is designed for easy marking of deep holes or narrow areas. These construction pencils are the great choice for woodworking tools, construction tools, carpenter tools, contractor tools, wood carpentry tools and architect tools
  • Extra Refills in 2 Colors for Versatile Marking: The construction mechanical pencil comes with 12 extra 2.8mm refills, including 6 red and 6 black refills. The black refill is suitable for light surfaces, while the red wax is perfect for dark surfaces. Our carpenter mechanical pencil makes sure that you'll have an ample supply for extended use
  • Built-in Sharpener: Our construction pencil comes with a built-in sharpener to ensure the mechanical pencil tip is always sharp and ready for use. Never buy an extra pencil sharpener again. A great tool for any woodworker pencil, contractor pencils. The refill can easily be extended or retracted with a simple click of the pencils mechanical, allowing you to work more efficiently and accurately
  • Portable Clip Design: Our deep hole construction pencil features a portable clip design, easy to carry and attach to your pocket or tool box, so that you can keep the carpenter pencils mechanical close at hand, making it a convenient tool to have on the go. Great gifts choice for carpenters
  • Stronger Pencil Lead: The black refills are made of lead, sturdy and smooth. The red refills are made of wax, clear and light. These marking pencils are much thicker and stronger than normal pencils during the marking process of construction work, suitable for various surfaces, such as glasses, metal, boards, floors, walls, furniture, etc. The written marks can be easily wiped with a wet paper towel when needed
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common setup and run problems

Playwright says a browser executable is missing

The installed package may have changed while its browser binaries were not installed or updated. Run npx playwright install, or install only the required engine with a command such as npx playwright install chromium.

A Linux machine or CI runner fails to launch a browser

The host may lack system libraries needed by the browser. Try npx playwright install --with-deps where supported, or install dependencies with npx playwright install-deps. The precise requirement depends on the Linux environment.

Chrome or Edge is not the browser that launches

Branded Chrome and Edge are separate from Playwright’s bundled browser builds and are not installed by default. Confirm that the branded browser is available, then configure the matching channel in the intended project. If testing the browser engine rather than a branded distribution, use the default Playwright browser instead.

Browser download fails behind a corporate proxy

The browser guide documents proxy and custom download-host environment variables for restricted networks. Follow that guidance or ask your network administrator for the approved artifact route; do not disable certificate checks. If your environment uses a custom root certificate, use the trusted certificate configuration described by the browser documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Milwaukee 48-22-3104 Inkzall Point Marker, Fine, Black, 4-Pack
  • Milwaukee Ink all Fine Point Marker, Black, 4 Per Pack
  • 4 per pack Features Clog Resistant Marker Tip Writes through Dusty, Wet and Oily Surfaces Durable Marker Tip for Writing on Concrete, OSB and Rough Surfaces
  • Clog resistant tip writes on dusty, wet and oily surfaces and is optimized for rough surfaces such as OSB, cinderblock and concrete
  • Hard hat clip- attaches for easy access
  • Quick dry time with reduced smearing and marking

The test times out or cannot find an element

First verify that navigation reached the expected page and that the locator’s role and accessible name match the rendered interface. Prefer a locator for a meaningful element and a web-first assertion for the state you need. Use UI mode, a trace, or headed execution to inspect the actual sequence before increasing timeouts or introducing waits.

Run Playwright in CI

The initializer can create an optional GitHub Actions workflow. For another CI provider, use the official Continuous Integration guide and make sure the job installs the browser binaries and any required Linux dependencies for its environment. Keep the Playwright package and browser installation aligned when updating dependencies; a local browser cache should not be assumed to exist on a fresh CI runner.

Or skip the browser setup

If your goal is a website screenshot rather than an interactive end-to-end test, ScreenshotNeo can return a screenshot or PDF from one GET request. For example, using the documented API call:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Before capture, it accepts cookie or consent banners like a visitor and removes 60+ known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sign up for ScreenshotNeo free to try 1,000 screenshots a month with no card.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.