How can I get an XPath or any other element for these dropdowns? Now for the first drop down with the value= 'Adrian Clarke,' I was able to get the Xpath and run it successfully. For the second drop-down I got the Xpath but since its the same name name' Adrian Clarke' i believe its not a unique Xpath and therefore it fails. Select functionality nor sends keys work or CSS Selector works. Is there any way around for this?

enter image description here


1 Answer 1


I would suggest to use something like this:

List<WebElement> listOfElements = driver.findElements(By.xpath(yourXpath));

for(WebElement element : elements){
    //actions with elements you intend to perform
    // or use index for any specific element in list

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.