I used this piece of code but no luck, I get error waiting for selector
Page popup = page.waitForPopup(() -> {
page.click("a[target='_blank']");
});
I used this piece of code but no luck, I get error waiting for selector
Page popup = page.waitForPopup(() -> {
page.click("a[target='_blank']");
});
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.
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();