I'm trying to select a value from a small dropdown that appears to be a "ul" Here's what I see in Firebug:
<button class="btn btn-default dropdown-toggle" aria-expanded="true" aria-haspopup="true" data-toggle="dropdown" type="button">
<ul class="dropdown-menu">
<li>
<a href="javascript:void(0)">1</a>
</li>
<li>
<a href="javascript:void(0)">2</a>
</li>
<li>
<a href="javascript:void(0)">3</a>
Here's what I have so far, in Java:
public void selectPhoneType(String option)
{
driver.findElement(By.className("caret")).click();
new WebDriverWait(driver, 5).until(ExpectedConditions.visibilityOfElementLocated(By.className("dropdown-menu")));
WebElement element = driver.findElement()
}
Let's say I wanted to select/click on option "1". How would I complete my code? I haven't worked with "li" too much so I tried using a select, which obviously didnt work. Any help would be appreciated! Thanks