I am trying to click a menu item from a navigation bar. I was able to click the first menu item and navigate to that page. But when I tried to navigate to other pages it always gives ElementNotVisibleException.
HTML for the menu items.
<ul id="yw1" class="dropdown-menu">
<li id="people_add"><a tabindex="-1" href="/index.php/People/add"><i class="fa fa-plus fa-1x "></i> Add People</a></li>
<li id="people_search"><a tabindex="-1" href="/index.php/people/search"><i class="fa fa-search fa-1x "></i> Search People</a></li>
<li id="people_merge"><a tabindex="-1" href="/index.php/people/mergeDup"><i class="fa fa-user fa-1x "></i> Merge Duplicates</a></li>
<li id="bulk_insert"><a tabindex="-1" href="/index.php/BulkInsert/Admin"><i class="fa fa-file fa-1x "></i> Bulk Insert</a></li>
</ul>
This code works for the first menu item.
driver1.findElement(By.id("people_add")).click();
But It doesn't work for the second menu item or any other.
driver1.findElement(By.id("people_search")).click();
I tried the xpath for the second menu item. but it also didn't work.I still got element not visible exception again.
How can I fix this?