ruby selenium option
module ScriptRunningFramework
module Patch
module ComboAction
def choose(target, accurate = true)
value = target.class == Symbol ? Sandbox::arguments[target.id2name] : target
option = self.find_elements(:tag_name=>'option').find do |o|
if accurate
o.text.eql?(value)
else
o.text.include?(value)
end
end
if option .nil?
# Util::debug("option #{args[0].encode('utf-8')} not found", :error)
# argument['actual'] = ''
else
option.click
if target.class == Symbol
Sandbox::arguments[arg.id2name]['actual'] = option.attribute['value']
end
end
end
end
end
end