My code is like this..
<ul class="sb_dropdown" style="display: none;">
<li id="sb_up_arrow" class="uiebatesca"/>
<li>
<label data-search-for="all">
<strong>All</strong>
</label>
</li>
<li style="background-color: transparent;">
<label data-search-for="Automotive">Stores</label>
</li>
<li>
<label data-search-for="Beauty">Deals</label>
</li>
</ul>
</form>
Now i want to select Stores
by using webdriver with java.
I tried by using:
List<WebElement> elementsList = driver.findElements(By.xpath("//form[@id='ui_element']/ul/li"));
Select ddvalues=new Select(elementsList.get(1));
ddvalues.selectByIndex(1);
But this is not working...
Is there any alternate ways to select this Stores
.
I tried to focus move to the "Stores" label, with this code...
Actions builder = new Actions(driver);
builder.moveToElement(elementsList.get(i)).perform();
elementsList.get(i).click();
but this is also not working...