title: Protractor clicking through an array of elements
body: <p>I'm quite new to e2e testing and in using protractor / jasmine framework. I know how to get an array of elements and also how to click on an anchor. But how would / is it even possible to click through a list of anchors returned by a element selector / repeater?</p>
  
  <p>I've been trying various ways, but as an example (latest one which hasn't been deleted lol) this is what I got:</p>
  
  <pre><code>element.all(by.repeater('link in links')).then(function(links) {
      links.forEach(function(link) {
  
          link.click().then(function() {
              console.log('callback for click ');
  
          });
      });
  });
  </code></pre>
  
  <p>This appears to take the first element and click through, however come the next iteration it hangs (I can see why, but struggling to figure a way to resolve - is this some kind of promise &amp; resolve factor i need to take into account?)</p>
  
  <p>The error coming back is</p>
  
  <blockquote>
    <p>Failed: stale element reference: element is not attached to the page document</p>
  </blockquote>
  
  <p>Any guidance / link to help would be appreciated - googling hasn't returned anything of note to me so far...</p>
  
  <p>Thanks in advance!</p>