title: Selecting second anchor element within lists using protractor
body: <p>I have a list of anchor tags and have to test clicking the 2nd tag in the list.</p>
  
  <pre><code>&lt;ul id="shortcuts"&gt;
      &lt;li&gt;&lt;a ui-sref="app.journeyExplorer" href="#/journey-explorer/"&gt;&lt;span class="ng-binding"&gt;1&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a ui-sref="app.userGroupManager" href="#/user-group-manager"&gt;&lt;span class="ng-binding"&gt;2&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>After much investigation and testing reached at the conclusion that the correct statement should be:</p>
  
  <pre><code>element(By.id('shortcuts')).element(By.tagName('a')).get(1).click();
  </code></pre>
  
  <p>But it shows undefined. If I use get() it doesn't work. without get it clicks the 1st anchor tag in the list with a warning: 'More than one anchor tag found, in such case the 1st one is selected'</p>
  
  <p>Can someone please help out with this ? Thanks.</p>