robotframework - Robot Framework "Select From List" command error -


i trying choose option robot framework native keyword "select list" command, failed error message :

html page source:

<select id="reason" placeholder="please select" style="width: 100%; display: none;" class="m-b-xs" data-role="combobox" aria-disabled="false" aria-readonly="false"> <option value="a">assume</option> <option value="b">new</option> <option value="c">renew</option> <option value="d">purchase</option> <option value="e">refinance</option> <option value="f">reschedul</option> <option selected="selected" value="new">new</option> </select> 

i used value "assume" or "a":

choose application reason     select list    xpath=//select[@id="reason"]    assume 

test failed error message:

info : selecting option(s) 'assume' list 'xpath=//select[@id="reason"]'.   ..... fail :valueerror: option 'assume' not in list 'xpath=//select[@id="reason"]'. info : selecting option(s) 'a' list 'xpath=//select[@id="reason"]'. ..... fail : valueerror: option 'a' not in list 'xpath=//select[@id="reason"]'. 

but if replace value "assume" default vale "new":

choose application reason     select list    xpath=//select[@id="reason"]    new 

test passed.

can help? ahead.

i had similar issues select drop downs , tried , worked me.

click element   xpath=//select[@id="reason"] wait until element visible   xpath=//option[contains(text(),'${label}')] click element   xpath=//option[contains(text(),'${label}')] 

if want select static value form list.

click element   xpath=//select[@id="reason"] click element   xpath=//select/option[0] 

you can use text equal,

click element   xpath=//option[text()='${label}')] 

to ignore blank,

click element   xpath=//option[normalize-space(text())='assume'] 

Comments