I'm trying to select a value from a textbox that display a list of suggestions when something is typed, I've tried:
$browser.li(:xpath, "//div[@id='question1']/div/div[2]/input").select 'Value 1'
$browser.li(:text, /Value/).select
$browser.li(:text, /Value/).click
With this one I get the list displayed when I set a string in the text field:
$browser.text_field(:name => 'choice').set("Value")
and I try to select a value with this one:
$browser.li(:text, /Value/).when_present.click
but none seems to work, I can manage to make the browser display the list, but I need to select one value from de list. Any idea?
Here's an example of the HTML of the list when it gets displayed:
<ul class="ui-autocomplete" role="listbox">
<li class="ui-menu-item" role="menuitem"><a class="ui-corner-all" tabindex="-1">Value 1</a></li>
<li class="ui-menu-item" role="menuitem"><a class="ui-corner-all" tabindex="-1">Value 2</a></li>
<li class="ui-menu-item" role="menuitem"><a class="ui-corner-all" tabindex="-1">Value 3</a></li>
</ul>