I am facing a challenge where I need to click on the 2nd anchor tag in a list of anchor tags.
<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 trying different approaches, it was determined that the correct code should be:
element(By.id('shortcuts')).element(By.tagName('a')).get(1).click();
However, this code is showing as undefined. Using get() does not work and without it, the first anchor tag in the list is clicked with a warning stating 'More than one anchor tag found, in such case the 1st one is selected'.
If anyone has a solution to this problem, please assist. Thank you.