If by “Visual Studio” you mean Visual Studio Code (VS Code), set up Playwright by installing Node.js and the official Playwright extension, then running Test: Install Playwright from the Command Palette. The steps below are for VS Code; the available Playwright editor instructions do not establish an equivalent setup path for the full Visual Studio IDE.
Before you start
You need Node.js and VS Code for the documented editor workflow. Playwright’s VS Code guide recommends the LTS release of Node.js. Node.js is the JavaScript runtime; npm, which is included with Node.js, manages packages. Open a new terminal and run node --version to check that Node.js is available on your PATH. If the command is not recognized, install Node.js or fix your PATH before continuing. See Microsoft’s Node.js tutorial in VS Code and Playwright’s VS Code setup guide.
Install VS Code if you do not already have it. For an existing application, open its project folder in VS Code so Playwright’s files and dependencies are added to the right project. If you instead use the package-manager route below, its initializer can create a new project or add Playwright to an existing one.
Choose how to install Playwright
There are two supported routes: an editor-led setup through the VS Code extension, or a terminal-led setup through a package manager. Choose the extension if you want to configure and run tests from VS Code. Choose the package-manager route if you want to make project initialization explicit in the terminal, especially when setting up a repository or adding Playwright to an existing project. Avoid running both initializers in the same project unless you understand and intend to reconcile any duplicate or conflicting configuration.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →#1 Best Overall
- KEYBOARD: The keyboard works for Windows with hot keys that enable easy access to Media, My Computer, Mute, Volume up/down, and Calculator
- EASY SETUP: Experience simple installation with the USB wired connection
- VERSATILE COMPATIBILITY: This keyboard is designed to work with multiple Windows versions, including Vista, 7, 8, 10 offering broad compatibility across devices.
- SLEEK DESIGN: The elegant black color of the wired keyboard complements your tech and decor, adding a stylish and cohesive look to any setup without sacrificing function.
- FULL-SIZED CONVENIENCE: The standard QWERTY layout of this keyboard set offers a familiar typing experience, ideal for both professional tasks and personal use.
Route A: set it up from VS Code
- Open the Extensions view with Ctrl+Shift+X on Windows or Linux, or Cmd+Shift+X on macOS.
- Search for Playwright and install the official Playwright extension from Microsoft.
- Open the Command Palette with Ctrl+Shift+P or Cmd+Shift+P, then run Test: Install Playwright.
- Choose the browsers you want to test, such as Chromium, Firefox, or WebKit. The setup also offers an option to add a GitHub Actions workflow. Browser project selection can be revisited in
playwright.config.ts. - Open the Testing icon in the Activity Bar. Use the Test Explorer to find and run the generated example test.
The extension route keeps the initial workflow inside the editor, but the result is still a Playwright project with configuration and browser choices that matter when running tests elsewhere, such as in CI.
Route B: initialize with a package manager
In a terminal opened at the intended project location, run one of these documented commands:
npm init playwright@latestyarn create playwrightpnpm create playwright
The initializer prompts you to choose JavaScript or TypeScript, select a test directory, decide whether to add a GitHub Actions workflow, and choose whether to install browser binaries. It uses tests as the default test directory, or e2e if a tests directory already exists. It creates a Playwright configuration file, package metadata and lock files as appropriate, and an example spec. In an existing project, review the changes to its package manifest and lock file before committing them. See the official Playwright installation guide for the initializer details.
Pick one route for the initial setup. If the package-manager initializer already created the project, open that folder in VS Code and use the extension to work with it; you do not need to initialize the same project a second time.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #2
- Reliable Plug and Play: The USB receiver provides a reliable wireless connection up to 33 ft (1), so you can forget about drop-outs and delays and you can take it wherever you use your computer
- Type in Comfort: The design of this keyboard creates a comfortable typing experience thanks to the low-profile, quiet keys and standard layout with full-size F-keys, number pad, and arrow keys
- Durable and Resilient: This full-size wireless keyboard features a spill-resistant design (2), durable keys and sturdy tilt legs with adjustable height
- Long Battery Life: MK270 combo features a 36-month keyboard and 12-month mouse battery life (3), along with on/off switches allowing you to go months without the hassle of changing batteries
- Easy to Use: This wireless keyboard and mouse combo features 8 multimedia hotkeys for instant access to the Internet, email, play/pause, and volume so you can easily check out your favorite sites
Install the browsers Playwright will run
Playwright Test needs browser binaries that match the installed Playwright version. The package setup and the browser download are related but distinct: having the test package installed does not guarantee that the required browsers are present.
- Install the default browsers with
npx playwright install. - Install only Chromium with
npx playwright install chromium. - On Linux systems that need browser system packages, run
npx playwright install-deps. In a CI setup, or where you want the Chromium browser and its dependencies installed together, the browser guide also documentsnpx playwright install --with-deps chromium.
Choose browsers based on the coverage you need and the environments that will run the tests. A test that passes in Chromium alone does not demonstrate that it passes in Firefox or WebKit; configure and run the browser projects you actually need. Consult Playwright’s current browser documentation for installation details. Browser downloads come from Microsoft’s CDN by default. A proxy, firewall, or custom certificate policy can interfere with the download, so restricted networks may need proxy or certificate configuration.
Browser versions are coupled to Playwright releases. After updating @playwright/test, rerun npx playwright install if the matching browser binaries need updating. Check the installed CLI version with npx playwright --version. Do not assume a browser downloaded for an older package version is the right one for the updated package.
Run a test and confirm what passed
In VS Code, open the Testing view and locate the generated example in Test Explorer. Use the play control next to the test to run one test, or use the relevant controls to run a file or the project. If the project has more than one browser project configured, use the Playwright sidebar’s browser projects to run against the browser configurations you intend to verify.
Recommended Free Tools
Rank #3
- All-day Comfort: The design of this standard keyboard creates a comfortable typing experience thanks to the deep-profile keys and full-size standard layout with F-keys and number pad
- Easy to Set-up and Use: Set-up couldn't be easier, you simply plug in this corded keyboard via USB on your desktop or laptop and start using right away without any software installation
- Compatibility: This full-size keyboard is compatible with Windows 7, 8, 10 or later, plus it's a reliable and durable partner for your desk at home, or at work
- Spill-proof: This durable keyboard features a spill-resistant design (1), anti-fade keys and sturdy tilt legs with adjustable height, meaning this keyboard is built to last
- Plastic parts in K120 include 51% certified post-consumer recycled plastic*
For a first success check, confirm that the example reports as passed and note which browser project ran. A passing Chromium run is evidence for that run in Chromium, not a result for every configured browser. To run from a terminal instead of the editor, use npx playwright test; the running and debugging tests guide covers command-line execution.
Use VS Code’s test tools after setup
Debug a failing test
Set a breakpoint in the test, then select Debug Test. The extension can launch the browser for debugging so you can inspect execution at the breakpoint. This is useful when a test fails because an action or assertion occurs at the wrong point in the page lifecycle.
Record a starting test
In the Testing sidebar, choose Record new to open a browser and record interactions into a test. The generator prioritizes role, text, and test-id locators and can improve a locator when multiple elements match. Treat generated code as a starting point: check that the selected locator identifies the intended control and that the assertions express the behavior you need. The Playwright test generator guide explains the generator.
Inspect a trace
The VS Code guide describes trace inspection features including step timelines, DOM snapshots, network requests, console messages, and screenshots. These artifacts can help distinguish a locator problem from a failed request or an unexpected page state.
Rank #4
- 【Dreamy Rainbow Gaming Keyboard】K521 Gaming Keyboard Adopts a Different LED Backlight Design, Upgraded on the Traditional LED Backlight Effect, Making the Light More Penetrating, Giving You a More Dazzling Visual Effect, Making Your Gaming Process More Enjoyable
- 【One Touch Opens & Visual Feast】The K521 Red Dragon Keyboard has a One-Touch on/off Lighting Button for Added Convenience. It also has a Three-Position Adjustable Breathing Mode and a Four-Position Adjustable Brightness Lighting Mode
- 【Mechanical Feeling & Fast Tapping】The PC Keyboard Keys are Designed for Mechanical Feeling, Giving You a Better Feel During Use and the Ability to Trigger Keys Quickly, Allowing You to Win All Your Games
- 【19 Keys Anti-Ghosting Keyboard】Anti-Ghosting Ensures Every Button Can Be Triggered. This Allows You to Trigger Key Combinations In The Game Accurately, And Each Skill Can Be Accurately Released to Increase Your Winning Rate. Redragon K521 Will Be Your Perfect Partner
- 【12 Multimedia Combination Keys】The K521 Wired Gaming Keyboard is Equipped with 12 Multimedia Keys That Can Greatly Enhance Your Gaming/Office Efficiency and Make It More Convenient to Use
Or skip the browser setup
If your actual goal is to save website screenshots rather than write and run browser automation tests, ScreenshotNeo is a separate screenshot API and MCP server—not a replacement for Playwright Test. A single GET request can return a PNG, JPEG, WebP, or PDF. For example, this cURL request saves a WebP screenshot:
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 documentation for request options. Cookie banners are accepted or removed before capture, along with supported newsletter popups and chat widgets; each of those steps can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and responses identify the page verdict and billing status in headers. An MCP server lets AI agents use screenshot, page-info, and PDF-capture tools. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots. Sign up for free to try it with 1,000 screenshots a month and no card.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot common setup failures
node or npm is not recognized
VS Code’s terminal cannot find the Node.js runtime or package manager on PATH. Install Node.js, then open a new terminal (and restart VS Code if necessary) and check node --version again. The VS Code Node.js tutorial explains the runtime and npm relationship: Microsoft’s Node.js tutorial.
The test is listed but the browser will not launch
Check that the browser binaries for the configured project are installed. Run npx playwright install, or install the specific browser project with npx playwright install chromium as appropriate. If you recently updated Playwright, reinstall browsers so they match the package version. On Linux, missing system dependencies can also prevent launch; use the browser guide’s npx playwright install-deps guidance.
The browser download fails or stalls
Check whether your network permits downloads from Microsoft’s CDN. Corporate proxies, firewalls, and custom certificate requirements can block or disrupt installation. Use Playwright’s browser documentation for proxy and custom certificate configuration rather than repeatedly retrying without changing the network setup.
Best Value
- All-day Comfort: This USB keyboard creates a comfortable and familiar typing experience thanks to the deep-profile keys and standard full-size layout with all F-keys, number pad and arrow keys
- Built to Last: The spill-proof (2) design and durable print characters keep you on track for years to come despite any on-the-job mishaps; it’s a reliable partner for your desk at home, or at work
- Long-lasting Battery Life: A 24-month battery life (4) means you can go for 2 years without the hassle of changing batteries of your wireless full-size keyboard
- Simply plug the USB receiver into a USB port on your desktop, laptop or netbook computer and start using the keyboard right away without any software installation
- Simply Wireless: Forget about drop-outs and delays thanks to a strong, reliable wireless connection with up to 33 ft range (5); K270 is compatible with Windows 7, 8, 10 or later
No tests appear in Test Explorer
Confirm that VS Code has the intended project folder open, that the project contains its Playwright configuration and test files, and that the official extension is installed. If setup was performed in another folder, open that folder instead. You can also run npx playwright test in the project terminal to see whether the test runner discovers tests outside the editor.
The extension and terminal seem to use different setups
Check the VS Code workspace and terminal location, then inspect the project’s package manifest and playwright.config.ts. A common cause is opening a parent folder or a different repository from the one where the initializer added the configuration. Run npx playwright --version from the project directory to identify the local CLI version, and install matching browser binaries there.
Frequently Asked Questions
Can I install Playwright in the full Visual Studio IDE?
The editor-specific Playwright instructions covered here are for Visual Studio Code. They do not establish a corresponding workflow for the full Visual Studio IDE.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallDo I need to install every Playwright browser?
No. Install the browsers required by the browser projects you plan to run; for example, the browser guide documents installing Chromium alone with npx playwright install chromium.
Quick Recap
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.

