0

I used this piece of code but no luck, I get error waiting for selector

        Page popup = page.waitForPopup(() -> {
        page.click("a[target='_blank']");
     
    });
    
Meghana
  • 3
  • 3

2 Answers2

0

I used an alternative approach for my issue by creating new Page.

    Page newPopUpWindow = page.context().browser().newContext().newPage();

This opens up a new Window and we can navigate to the url we need to.

Meghana
  • 3
  • 3
0

You can open new tab (not new window) using this

Page newTab = page.context().newPage();

but remember you initial Page should be opened with newContext() or else you will get a playwright exception. page = browser.newContext().newPage();

Meghana
  • 111
  • 7