Skip to content
CodeKruPro

Practice

Playwright JavaScript

Master Playwright with 70 hands-on assignments, from beginner to advanced. Write real code, execute it against a live site, and get instant feedback.

  • 70 lessons
  • 17 modules
  • Beginner to Advanced
  • Lessons 1 to 9 free

Keep your progress

Signed-in learners keep solved lessons and a leaderboard rank. Lessons also work without an account.

Sign in to save progress

Getting Started

3 lessonsBeginner
  1. Your First Playwright Script
  2. Open Several Pages with page.goto()
  3. Use goBack() and goForward()

Selectors

6 lessonsBeginner
  1. Select Element by CSS ID
  2. Select Element by Text Content
  3. Select Element by Role
  4. Select Element by CSS Class and Tag
  5. Select Element by XPath
  6. Find Multiple Elements

Refining Locators

4 lessonsBeginner
  1. getByLabel and getByPlaceholder
  2. CSS Attribute Selectors
  3. Locator Chaining and Filtering
  4. nth, first, and last Locators

Page Interactions

7 lessonsBeginner
  1. Click Elements
  2. Fill Input Fields
  3. Get Text Content and Inner Text
  4. Get Element Attributes
  5. Get Input Values
  6. Get CSS Property Values
  7. Clear Fields and Get Inner HTML

Checkboxes & Radio Buttons

4 lessonsIntermediate
  1. Check and Uncheck Checkboxes
  2. Verify Checkbox State
  3. Select Radio Buttons
  4. Handle Multiple Checkboxes

Dropdowns

5 lessonsIntermediate
  1. Select Dropdown by Value
  2. Select Dropdown by Label
  3. Select Dropdown by Index
  4. Get All Dropdown Options
  5. Multi-Select Dropdown

Element States

3 lessonsIntermediate
  1. isVisible and isHidden
  2. isEnabled and isDisabled
  3. isEditable State

Assertions (expect API)

5 lessonsIntermediate
  1. expect - toBeVisible
  2. expect - toHaveText
  3. expect - toHaveValue
  4. expect - toBeChecked
  5. expect - toHaveAttribute

Waiting

4 lessonsIntermediate
  1. Wait for Element to Appear
  2. Wait for Element to Disappear
  3. waitForLoadState
  4. Custom Timeout

Dialogs

4 lessonsIntermediate
  1. Handle Alert Dialog
  2. Handle Confirm Dialog
  3. Handle Prompt Dialog
  4. Handle Sequential Dialogs

Frames

4 lessonsAdvanced
  1. frameLocator by ID
  2. frameLocator by Name
  3. Nested Frames
  4. Content Between Frame and Main Page

Multiple Pages & Tabs

3 lessonsAdvanced
  1. Open New Tab
  2. Handle Popup Window
  3. Switch Between Pages

Keyboard & Mouse

5 lessonsAdvanced
  1. Keyboard Press
  2. Keyboard Type
  3. Mouse Hover
  4. Double Click and Right Click
  5. Drag and Drop

JavaScript Evaluation

4 lessonsAdvanced
  1. page.evaluate - Execute JavaScript
  2. page.$eval - Evaluate on Element
  3. Scroll with JavaScript
  4. Modify DOM with JavaScript

Screenshots

2 lessonsAdvanced
  1. Full Page Screenshot
  2. Element Screenshot

Tables

4 lessonsAdvanced
  1. Read Table Headers
  2. Get Specific Table Cell Value
  3. Count Table Rows
  4. Iterate Table Data

Advanced Topics

3 lessonsAdvanced
  1. Manage Cookies
  2. Dynamic Elements with Waits
  3. Get Page Content

Practice on TestKru

Explore the elements and interactions used in these assignments.

Open TestKru