I am trying to select an item in a SelectList element that is loaded dynamically.
I'm using a wait_until like so:
select_list(:oem, :id => 'oem_1')
def wait_for_oem(oem_name)
self.oem_element.wait_until(20) do
self.oem_options.include? oem_name
end
end
This works great when my list only has a few items. Unfortunately, my list sometimes has 3000 items. When this happens, the above wait takes a few minutes to return (even though the list only takes a few seconds to populate).
I also tried:
def wait_for_oem(oem_name)
self.oem_element.wait_until(20) do
self.oem_options.length > 1
end
end
That wasn't any better, I can put in a sleep 5
to work around the issue, but I'd prefer to avoid that.
Can you suggest wait options with better performance?