Following code I need to identify third li element(user list). How I co do using selenium?
I have tried using,
String usertype= //td[text()='product']
String usersubtype= li[@class='user-list dropbutton-action secondary-action']
String adduser = usertype +"following-sibling::td//" +usersubtype+"/a"
I must use following method. Because my code usertype and usersubtype values coming from different place
(above strings just for reference)
But it could not work out. Please help me to identify the third li element(user list)
I need to identify following element in the code
<li class="content-list dropbutton-action secondary-action"><a href="/admin/structure/eck/entity/product">User list</a></li>
Below is my code snippet:
<tr class="even">
<td>product</td>
<td>product</td>
<td>
<div class="code-wrapper dropbutton-multiple">
<div class="dropbutton-widget">
<ul class="dropbutton">
<li class="user dropbutton-action"><a href="/user/userlist/abc/productcontent/add">Add User</a></li>
<li class="dropbutton-toggle"><button type="button"><span class="dropbutton-arrow"><span class="visually-hidden">List actions</span></span></button></li>
<li class="user-list dropbutton-action secondary-action"><a href="/user/userlist/abc/productproduct">User list</a></li>
<li class="user-list dropbutton-action secondary-action"><a href="/user/userlist/abc/productproduct/types">Test list</a></li>
<li class="edit dropbutton-action"><a href="/user/userlist/abc/productmanage/product?destination=/admin/structure/eck/entity_type">Edit</a></li>
<li class="delete dropbutton-action"><a href="/user/userlist/abc/productmanage/product/delete?destination=/admin/structure/eck/entity_type">Delete</a></li>
</ul>
</div>
</div>
</td>
