I have used the following example to target a pop-up window/newtab, but the methods available to me after the fact are limited. I can only really do things like capture the URL and close the tab (among other things).
What I am trying to do is interact with a google/twitter sign in pop-up, but puppeteer doesn't seem to have a solution for multiple window handles, at least when trying to interact as in click elements.
const newPagePromise = new Promise(x => browser.once('targetcreated', target => x(target.page()));
await page.click('my-link'); //Opens pop-up window
const newPage = await newPagePromise;
I'm looking to have something like this (in addition to the code written above):
const element = await newPage.$(selector);
await element.click();
This does not work. Has anyone else had this need?