Selecting second anchor element within lists using protractor
问题 I have a list of anchor tags and have to test clicking the 2nd tag in the list. <ul id="shortcuts"> <li><a ui-sref="app.journeyExplorer" href="#/journey-explorer/"><span class="ng-binding">1</span></a></li> <li><a ui-sref="app.userGroupManager" href="#/user-group-manager"><span class="ng-binding">2</span></a></li> </ul> After much investigation and testing reached at the conclusion that the correct statement should be: element(By.id('shortcuts')).element(By.tagName('a')).get(1).click(); But