Skip to content
CodeKruPro

Switch Between Pages

52/70

Switch Between Pages

With browser contexts, all pages are accessible. Use context.pages() to list them and page.bringToFront() to focus a specific page.

Task:

  1. Create a context with two pages: Buttons and TextFields
  2. Print how many pages are open
  3. Bring the first page to front and print its title
  4. Bring the second page to front and print its title

Expected output:

Open pages: 2
Front page: Buttons
Front page: Text Fields