Back to BlogPlaywright
Getting Started with Playwright in 2024
Everything you need to know to start browser automation with Playwright. From installation to your first test.
June 6, 20268 min read
Getting Started with Playwright in 2024
Playwright has become the go-to framework for modern browser automation. In this guide, we will cover everything you need to get started.
Installation
hljs bashnpm init playwright@latest
Your First Test
hljs typescriptimport { test, expect } from "@playwright/test";
test("homepage has title", async ({ page }) => {
await page.goto("https://example.com");
await expect(page).toHaveTitle(/Example/);
});
Running Tests
hljs bashnpx playwright test
Happy testing! 🚀
playwrightautomationtestingtutorial