Rayrun
← Back to videos

How to install Playwright in Visual Studio Code Tutorial

In this video we will see how to install Playwright using VSCode and learn about Playwright Test Extension

In this video tutorial, we learn how to install the Playwright testing library using Visual Studio Code (VS Code). Playwright, an open-source cross-browser testing library developed by Microsoft, allows for reliable end-to-end web testing across multiple programming languages.

To install Playwright with VS Code, follow these steps:

  1. Create a new folder and open it in VS Code.
  2. Go to Extensions and search for "Playwright Test."
  3. Install the Playwright Test extension.

With this extension, you can install Playwright, run single or multiple tests with a single click, select browsers used by the test execution, debug, pick locators, and generate tests automatically.

Next, we need to install Playwright in the project:

  1. Click on View > Command Palette.
  2. Type "install playwright" and press Enter.
  3. Select browsers you want to use for running tests.
  4. Choose to use JavaScript or Typescript (by default, Typescript is used if the "use JavaScript" checkbox is not selected).
  5. Click OK.

VS Code will now install Playwright and generate the entire project files. The Explorer menu will display the folder structure containing the node_modules, package.json, playwright.config, and test example files. The Testing extension will show the tests folder with test files and scenarios.

You can run tests in headless mode (without displaying the browser instance) or with the browser instance visible by toggling the "show browser" option.

Other features of the Playwright Test extension include:

  • Generating locators by picking a locator from the browser.
  • Recording manual actions, generating tests, and saving them in any language.

With Playwright installed, you can now create automated tests for your web applications using VS Code.

Related Videos

#16 - ARIA and how Playwright is making use of it to identify UI controls?
#16 - ARIA and how Playwright is making use of it to identify UI controls?
How to Code a Test Automation on Youtube | Playwright JS
How to Code a Test Automation on Youtube | Playwright JS
Playwright - Set timeout, parallelisation and retries directly in your test files
Playwright - Set timeout, parallelisation and retries directly in your test files
Maximize Window | Playwright Tutorial - Part 72
Maximize Window | Playwright Tutorial - Part 72
TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].