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?
else
option
.click
if target
.class == Symbol
Sandbox::arguments
[arg
.id2name
]['actual'] = option
.attribute
['value']
end
end
end
end
end
end
转载请注明原文地址: https://win8.8miu.com/read-6541.html