🎯 Multiple Window Practice
In Playwright, every browser tab or window is represented
by a Page object.
Use this page to practice:
context.waitForEvent('page')
page.waitForEvent('popup')
context.pages()
page.bringToFront()
page.close()
page.title()
page.url()
Main Window Status: Active
1️⃣ Open External Websites in New Tabs
Playwright Window
Opens Playwright official website in a new tab.
TutorialsNinja Window
Opens TutorialsNinja demo application in a new tab.
No external window opened yet.
3️⃣ SpeedwayTech Child Window
This button opens a completely new child window.
The child window contains input fields,
buttons and text that you can automate using Playwright.
Child Window Status: Not Opened
4️⃣ Popup Window Practice
This button opens a smaller popup window.
You can capture it using:
const popupPromise = page.waitForEvent('popup');
await button.click();
const popup = await popupPromise;
5️⃣ Open Two Child Windows
Click the buttons below to open Child Window 1
and Child Window 2.
This is useful for practicing:
context.pages()
pages[0]
pages[1]
pages[2]
Multiple Window Status: Ready
6️⃣ Main Window Information
Window Information Will Appear Here
📝 Playwright Practice Tasks
-
Open the main SpeedwayTech practice page.
-
Click Open Playwright Window.
-
Capture the newly opened Page object.
-
Print the new page URL and title.
-
Verify the URL contains playwright.dev.
-
Close the new window.
-
Open SpeedwayTech Child Window.
-
Enter username inside the child window.
-
Click Login.
-
Verify the welcome message.
-
Bring the parent window to front.
-
Print the total number of pages using context.pages().