Continuous Test Orchestration And Execution Platform Online

Perform automated and live-interactive testing on 3000+ real desktop and mobile devices online.

Why Playwright is not able to handle multiple windows or tabs?

Playwright automation framework uses WebDriver protocol that does not allow multiple windows and tabs in the same context. To handle multiple windows and tabs, you need to switch contexts between them by using the functions mentioned below:

  • page.goto: to navigate to a new page in the current window.
  • page.close: to close the current window.
  • page.newPage: Function used to open a new page in a new window.
  • page.page: to get a list of current open pages.
  • page.close: to close the current window.

To interact with a specific window or tab:

  • page.switchToWindow: Function used to switch the current context to a different window or tab.
  • page.bringToFront: Function used for bringing specific windows or tabs to the front.
LambdaTest

Test your websites, web-apps, or mobile apps seamlessly with LambdaTest.

Start Free Testing
LambdaTest

Earn resume-worthy Selenium certifications that help you land a top job.

Learn More
LambdaTest

Test your web or mobile apps

Test orchestration and execution cloud of 3000+ browsers and OS

Support

24/7 support

Security

Enterprise grade security

Cloud

Fastest test execution cloud