I have this dropdown:
<select class="admin__control-select" data-bind="
attr: {
name: inputName,
id: uid,
disabled: disabled,
'aria-describedby': noticeId
},
hasFocus: focused,
optgroup: options,
value: value,
optionsCaption: caption,
optionsValue: 'value',
optionsText: 'label'" name="product[business_line]" id="N2JWY3F" aria-describedby="notice-N2JWY3F"><option value=""> </option><option data-title="PU - 21" value="425">PU - 21</option><option data-title="PU - 35" value="430">PU - 35</option></select>
The XPath is:
//*[@id="N2JWY3F"]
It has 2 options available: PU - 21 and PU - 35. I want to select the option: PU - 21.
I did this:
First, click on that dropdown:
driver.findElement(By.xpath("//*[@id=\"N2JWY3F\"]")).click();
How can I specify the option that I want? I tried different things and not one worked.