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?
1 Answer
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
}
ChroPath
extension? It is really handy when trying to find the locators of elements. Link - chrome.google.com/webstore/detail/chropath/…