Open New Tab
In Playwright, new tabs are created in the browser context. Use context.newPage() to open a new page (tab), or capture popups triggered by clicks.
Task:
- Launch browser and create a context:
browser.newContext() - Create first page, navigate to
https://testkru.com/Elements/Buttons - Create second page in the same context, navigate to
https://testkru.com/Elements/TextFields - Print titles of both pages
- Print total number of pages in the context
Expected output:
Page 1: Buttons Page 2: Text Fields Total pages: 2
TestKru