Skip to main content
Source Link
STE
  • 759
  • 6
  • 13
  • 27

Unable to locate element in a dropdown

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