My Html
<div id="example-1-tab-2" class="responsive-tabs-panel" style="display: none;">
<div class="freme_box">
<iframe class="demo-frame" src="dropdown/default1.html">
<html lang="en">
<head>
</head>
<body>
<div class="ui-widget">
<select id="combobox" style="display: none;">
<option selected="" value="Please Enter">Please Enter</option>
<option value="Afghanistan">Afghanistan</option>
<option value="Albania">Albania</option>
</select>
<span class="custom-combobox">
<input class="custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left ui-autocomplete-input" title="" autocomplete="off">
<a class="ui-button ui-widget ui-state-default ui-button-icon-only custom-combobox-toggle ui-corner-right" tabindex="-1" title="Show All Items" role="button">
<span class="ui-button-icon-primary ui-icon ui-icon-triangle-1-s"></span>
<span class="ui-button-text"></span>
</a>
</span>
</div>
</body>
</html>
</iframe>
</div>
My java
driver.switchTo().frame(0);
//driver.findElement(By.id("combobox")).clear();
List < WebElement > list = driver.findElements(By.tagName("select"));
for (WebElement li: list) {
System.out.println(li.getText());
}
I am able to print all the data from the dropdown list but that's not my intention. I just want to select a perticular value from that list.How to do this?