Playwright Tutorial

Session Storage in Playwright Session Storare in Playwright In Playwright, Session Storage is maintained per page (tab) within a browser context. Unlike Local Storage, there is no direct API like context.storageState() for Session Storage. Read more »
Locator Priority, getByRole() in Playwright Which attributes can Playwright use? Locator Uses getByRole() Accessible role + accessible name getByLabel() Associated <label> text getByPlaceholder() placeholder attribute getByAltText() alt attribute getByTitle() title attribute getByTestId() data-testid (or configured Read more »
Soft Assertions in Playwright These three assertions are among the most powerful features in Playwright Test. They help you write more reliable tests by handling retries and failures in different ways. expect.soft() (Soft Assertion) Read more »
Browser, Browser Context, Page in Playwright   1 browser can have more than 1 browser context in playwright? Yes. One browser instance can have multiple browser contexts in Playwright. In fact, this is one of Playwright’s Read more »
Common Options to Run Test cases Command Line Options to Run Test cases Here are the most common options available in the command line. Run all the tests npx playwright test Run test cases from a Read more »
Assertions in Playwright Assertions in Playwright: Playwright includes test assertions in the form of expect function. To make an assertion, call expect(value) and choose a matcher that reflects the expectation. There are many generic matchers like toEqual, toContain, toBeTruthy that can be used Read more »
Page Object Model (POM) in Playwright Page Object Model (POM) in Playwright Google.Spec.ts //spec file which have test case import {test, Locator, Expect, chromium, Browser, Page, expect} from ‘@playwright/test’; import { googlePage } from ‘./Pages/googlePage’; //Import Read more »
Playwright Library: Launch Browser Playwright Library: Launch Browser: Playwright module provides a method to launch a browser instance. The following is a typical example of using Playwright to drive automation: import {test, Locator, Expect, Read more »
Playwright Test Playwright Test provides a test function to declare tests and expect function to write assertions. import { test, expect } from '@playwright/test'; test('basic test', async ({ page }) => { await page.goto('https://playwright.dev/'); const name Read more »
Installation and Running Tests Installation and Running Tests: Introduction​ Playwright Test was created specifically to accommodate the needs of end-to-end testing. Playwright supports all modern rendering engines including Chromium, WebKit, and Firefox. Test on Read more »

Subscribe now

Receive weekly newsletter with educational materials, new courses, most popular posts, popular books and much more!