title: Puppeteer Element Handle loses context when navigating
body: <p>What I'm trying to do:</p>
  
  <p>I'm trying to get a screenshot of every element example in my storybooks project. The way I'm trying to do this is by clicking on the element and then taking the screenshot, clicking on the next one, screenshot etc.</p>
  
  <p>Here is the attached code:</p>
  
  <pre><code>test('no visual regression for button', async () =&gt; {
    const selector = 'a[href*="?selectedKind=Buttons&amp;selectedStory="]';
    const browser = await puppeteer.launch();
    const page = await browser.newPage();
    await page.goto('http://localhost:8080');
    let examples = await page.$$(selector);
    await examples.map( async(example) =&gt; {
      await example.click();
      const screen = await page.screenshot();
      expect(screen).toMatchImageSnapshot();
    });
    await browser.close();
  });
  </code></pre>
  
  <p>But when I run this code I get the following error:</p>
  
  <pre><code>Protocol error (Runtime.callFunctionOn): Target closed.
  
    at Session._onClosed (../../node_modules/puppeteer/lib/Connection.js:209:23)
    at Connection._onClose (../../node_modules/puppeteer/lib/Connection.js:116:15)
    at Connection.dispose (../../node_modules/puppeteer/lib/Connection.js:121:10)
    at Browser.close (../../node_modules/puppeteer/lib/Browser.js:60:22)
    at Object.&lt;anonymous&gt;.test (__tests__/visual.spec.js:21:17)
        at &lt;anonymous&gt;
    at process._tickCallback (internal/process/next_tick.js:169:7)
  </code></pre>
  
  <p>I believe it is because the element loses its context or something similar and I don't know what methods to use to get around this. Could you provide a deeper explanation or a possible solution? I don't find the API docs helpful at all.</p>