Running Watir tests where I am looking to select a random value from a select_list element. By default, one of the options has the attribute disabled value="true"
Currently I am putting all the options into an array like such:
@browser.select_list(:class, 'preset-select').options.to_a.sample.click
Normally this works in selecting a single option, but I occasionally run into an issue where it tries to click on the disabled object instead.
How would I validate this to ensure the object returned is not a disabled one?
You can filter the list of options to those that are enabled: