I am attempting to locate and interact with this specific div element.
<div class="leaflet-marker-icon marker-cluster marker-cluster-small leaflet-clickable leaflet-zoom-animated" style="margin-left: -6px; margin-top: -6px; width: 12px; height: 12px; opacity: 1; transform: translate(702px, 396px); z-index: 396;" title="13 tracks listened in , UA">
My goal is to do the following:
WebElement cluster = driver.findElement(By.cssSelector("marker-cluster-small"));
However, my attempts have not been successful. Here is what I have tried:
WebElement cluster = driver.findElement(By.xpath("//div[@class='leaflet-marker-icon marker-cluster marker-cluster-small leaflet-clickable leaflet-zoom-animated']"));
Unfortunately, neither of these methods are working as expected. The first method resulted in an "Unable to locate element" error message. While the second method did not throw any errors, when I try to click on the element using:
cluster.click();
nothing seems to happen. Could you please advise on what I might be doing incorrectly? Thank you.