🚀 SpeedwayTech Playwright Waits & Multiple Windows Practice

Learn Auto Wait • Explicit Waits • Network Waits • Popups • Multiple Tabs

Auto Wait Visibility Attached/Detached URL Wait Loader API Wait Download Multiple Windows

🎯 Playwright Wait Practice

This page intentionally creates delayed elements, delayed text, loaders, URL changes, API calls, downloads and multiple browser windows.

Auto Waiting locator.waitFor() waitForURL() waitForLoadState() waitForRequest() waitForResponse() waitForEvent() context.waitForEvent('page')

1️⃣ Playwright Auto-Waiting

Click "Create Delayed Button". A new button will appear after 3 seconds. Playwright can automatically wait when an action is performed on a locator.

Status: Waiting for action

2️⃣ Wait Until Button Becomes Enabled

The Submit button becomes enabled after 4 seconds. Useful for understanding Playwright actionability checks.

Submit Button: Disabled

3️⃣ locator.waitFor() - Visible / Hidden

Use this section to practice waiting for an element to become visible or hidden.

4️⃣ Wait for Attached / Detached Element

Attached means the element exists in the DOM. Detached means it has been completely removed from the DOM.

5️⃣ Assertion Auto-Retry Practice

Click the button. The status text changes after 3 seconds. Practice: expect(locator).toHaveText()

Status: Not Started

6️⃣ waitForURL() Practice

Clicking the button starts navigation. After 3 seconds the URL changes to: #dashboard

Current Page: Home

7️⃣ Loader / Spinner Wait

Click Load Data. Loader appears and disappears after 4 seconds. Good practice for: locator.waitFor({ state: 'hidden' })

8️⃣ Dynamic Table Wait

Employee records are added after 3 seconds. Useful for assertions and element wait practice.

Name Role City

9️⃣ waitForRequest() & waitForResponse()

This button calls a public API. Use Playwright to start waiting for the request/response BEFORE clicking the button. Internet connection is required for this section.

API Status: Not Called

No API Data

    

🔟 waitForEvent('download')

Practice waiting for the download event.

Expected Filename: speedwaytech-wait-practice.txt

1️⃣1️⃣ waitForTimeout() Demo

This section is only for understanding a hard-coded wait. In real automation, condition-based waits are preferred.

0

🪟 Multiple Windows / Tabs Practice

Every browser tab/window is represented as a Playwright Page object. Practice: context.waitForEvent('page') page.waitForEvent('popup') context.pages() bringToFront() close()

Window 1

Open Playwright website in a new tab.

Window 2

Open TutorialsNinja in a new tab.

Window 3 - Local Popup

Opens a custom SpeedwayTech popup without requiring another HTML file.

Window Status: Main Window

1️⃣2️⃣ Popup Window Action Practice

The SpeedwayTech popup contains:

You can capture the popup using: page.waitForEvent('popup') and then perform actions on the returned Page object.

1️⃣3️⃣ Delayed Popup Practice

This popup opens after 3 seconds. Useful for understanding event waiting.

Delayed Popup: Not Opened