ul class="appt-dropdown-menu">
<li id="service-slot-blocker" class="slot-blocker-holder">
<li id="service-05b41399015375913">
<code class="light-blue"></code>
<span class="appt-details-dropdown-service-title">Facial</span>
<span class="appt-details-dropdown-service-time">59mins</span>
<div class="clearfix"></div>
</li>
<li id="service-sebd91399015377146">
</ul>
I want to select dropdown value-Facial. I tried the below options for finding the element:
driver.findElement(By.xpath("/html/body/div[2]/div[2]/div[1]/div[4]/div[3]/ul/li[2]/div[1]/ul/li[2]")).click();
------------------------------------------------------------------------------------------
WebElement s=driver.findElement(By.xpath("/html/body/div[2]/div[2]/div[1]/div[4]/div[3]/ul/li[2]/div[1]/ul/li[2]"));
s.click();
I am getting error as -element not visible
driver.findElement(By.xpath("//span[contains(.,'Facial')]")).click()
If not then more information is needed. Currently the html given isn't a "dropdown" so if it appears as a dropdown then the code is doing something to render it as such. In general html5 has this as a select element which can be parsed with it's ownSelectElement
class.