Select the item from the drop-down list

advertisements

I have this drop down list:

<div class="select_id" style="width: 592px;"><span class="left"></span><span class="center">103</span><a class="select-opener"></a></div>
<select class="id-hidden" name="ids"><option value="">Please select...</option>
<option value="a">a</option>
<option value="b">b</option>
<option value="c">c</option>
<option value="d">d</option>
<option value="e">e</option>

So i try to select item.

So i have this element:

val selectAccountDropDownListElement: WebElement =
  wait.until(ExpectedConditions.visibilityOfElementLocated(
    By.cssSelector(("div.select_id"))))

Open the drop down list:

selectAccountDropDownListElement.click()

And now how can i select an item from me drop down list ?


It is as simple as (docs):

singleSel("id").value = "a"

Or:

singleSel("id").selection = Some("a")