Question: how to handle the popup and access the popup to do some operations on it. 

```
const puppeteer = require('puppeteer');

async function run() {
    const browser = await puppeteer.launch();
    const page = await browser.newPage();
    await page.goto('https://example.com');
    await page.click(Launchpopup);
}

```

Answer: 
You should check out the documentation for v0.12.0-alpha, it describes how to interact with dialogs. 

```
const puppeteer = require('puppeteer');

puppeteer.launch().then(async browser => {
  const page = await browser.newPage();
  await page.goto('https://example.com');
  page.on('dialog', async dialog => {
    console.log(dialog.message());
    await dialog.dismiss();
    await browser.close();
  });
  page.evaluate(() => alert('1'));
});

```

Relevant [docs can be found here](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#class-dialog).
Puppeteer popup event

Starting with puppeteer version 1.12, a special ‘popup’ event has been added to the page, which allows you to catch new tabs and popups. We use it by rewriting the first example:

```
const puppeteer = require('puppeteer');         // puppeteer

const browser = await puppeteer.launch();       // run browser
const page = await browser.newPage();           // open new tab
await page.goto('https://example.com');            // go to site.com       

await page.waitForSelector('#goto');            // wait object load
const link = await page.$('#goto');             // declare object

const newPagePromise = new Promise(x => page.once('popup', x));

await link.click();                        // click, a new tab  opens
const newPage = await newPagePromise; 
await newPage.close();             // close it, for example
await browser.close();                          // close browser

```