Software Testing

Install Playwright on Windows

Install Playwright on Windows

Playwright is a modern automation framework for web testing. It is developed by Microsoft and supports multiple browsers such as Chromium, Firefox, and WebKit. Playwright allows testers and developers to automate web applications efficiently, providing reliable and fast execution of test cases.

Prerequisites

Before installing Playwright, ensure that you have the following:

  • Windows operating system
  • Node.js installed (version 14 or later)
  • Basic knowledge of command-line usage

Install Node.js

Playwright requires Node.js to run. Follow these steps to install Node.js:

 

After installation, verify Node.js by opening the Command Prompt (cmd) and running:

/> node -v

Install Playwright

Once Node.js is installed, you can install Playwright using npm (Node Package Manager). Follow these steps:

  • Open Command Prompt (cmd) on your Windows machine.
  • Run the following command to create a new project directory:

 

/> mkdir playwright-project && cd playwright-project

Install Playwright on Windows

 

Initialize a new Node.js project by running:

/> npm init -y

 

Initialize node.js Project

Install Playwright by executing the following command:

/> npm install -D @playwright/test

Install Playwright Command

Verify Playwright Install

After installation, verify Playwright by running:

/> npx playwright --version

Playwright version command

Install Browsers

Playwright requires browser binaries to run tests. Install them using:

/> npx playwright install

Install Playwright Browsers

 

That’s it. You have successfully installed Playwright on Windows 🎭. You can now use Playwright to automate web applications and run tests across multiple browsers.

Next Steps:

Write First Test:

Playwright Tutorials