Prev: Read text file and check multiple checkbox
Next: [ANN] Ruby/Tk-Kit for RubyInstaller 1.9.1p378rc2
From: KingMaker KingMaker on 20 May 2010 09:05 Hi Friends, I try to check the Multiple Checkboxes in the page. first i read the value in the text file and assing it to the variable. but the problem is that at the time only one check box are selected. textfile values: selectedLocationOids=0000025354000000630d selectedLocationOids=000002527100000062bc ______________________________________________________________________________ HTML Code: <input type="checkbox" value="0000025354000000630d" name="selectedLocationOids" id="selectedLocationOids" class="vmCheckbox"> <input type="checkbox" value="000002527100000062bc" name="selectedLocationOids" id="selectedLocationOids" class="vmCheckbox"> ______________________________________________________________________________ RUBY Script: require 'watir' include Watir require 'logger' opts = {} File.open("c:/test/Flow1.txt") do |f| f.each_line do |line| opts[$1] = $2 if line =~ /^(.*)=(.*)$/ end end @check_location = opts["selectedLocationOids"] @check_location1 = opts["selectedLocationOids"] ie.checkbox(:value,@check_location).set() ie.checkbox(:value,@check_location1).set() -- Posted via http://www.ruby-forum.com/.
|
Pages: 1 Prev: Read text file and check multiple checkbox Next: [ANN] Ruby/Tk-Kit for RubyInstaller 1.9.1p378rc2 |