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: 
Since version 0.13.0, you can use the following code:

```
... code to open popup...
const pages = await browser.pages(); // get all open pages by the browser
const popup = pages[pages.length - 1]; // the popup should be the last page opened

```
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).