My web app opens a new tab under some conditions. But when I try to get all tabs (await browser.pages())
I get only one back, the initial page.
How can I get the new page's object in my code?
This happens when you don't create new tab with puppeteer with await browser.newPage()
, but when you do something like this:
await (await browser.pages())[0].evaluate(() => {
window.open('http://www.example.com', '_blank');
});
The page won't be available in the browser.pages()
response.