Recently, I've delved into using Selenium Webdriver for automation purposes. The particular webpage that I'm looking to automate is infused with CSS styling. My current aim is to interact with a dropdown labeled "Admin", triggering it to display a list of options. From this list, I wish to select the option "User Access."
The snag lies in the fact that the source code of this specific dropdown "Admin" lacks an identifiable ID or Name attribute. Below you will find the relevant excerpt from the code:
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false>
Admin<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="usersAdmin">
Users Admin
</a>
</li>
<li>
<a href="userAccess">
User Access Admin
</a>
</li>
<li>
<a href="#">
Email Object Admin
</a>
</li>
</ul>
</li>
My primary goal at present is to pinpoint and select the value "User Access Admin" within the dropdown. Despite trying to leverage the findElement method to locate this object, the absence of an identifiable ID or name has proven to be a hindrance. Any suggestions on an effective alternative approach for achieving this task? It's worth mentioning that my coding language of choice is Java.