Here is an example I use to select all items from a select list.
#load all items into varaible
dbList = $ie.select_list( :name, 'DivBranch').getAllContents
#walk the list selecting each item as you go.
for dbl in dbList
$ie.selectBox( :name, 'DivBranch').select("#{dbl}")
End
Hope this helps,
--Mark
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of smanish
Sent: Wednesday, November 23, 2005 12:38 AM
To: [email protected]
Subject: [Wtr-general] selecting multiple items in multiple select
listthrows exception
Hi,
The doc for Watir::SelectList says that array item can be passed to
select method.
But seems not true and watir throws exception.
--------------------------
select( item )
This method selects an item, or items in a select box, by text. Raises
NoValueFoundException if the specified value is not found.
* item - the thing to select, string, reg exp or an array of string
and reg exps
--------------------------
But I get following exception when I execute
$ie.frame("mainFrame").select_list(:name ,"selectedTypes").select(
["SSH", "HTTPS"] )
-------------------------
c:/program files/ruby/lib/ruby/site_ruby/1.8/watir.rb:2945:in
`select_item_in_select_list': undefined method `matches' for ["SSH",
"HTTPS"]:Array (NoMethodError)
from c:/program files/ruby/lib/ruby/site_ruby/1.8/watir.rb:2944:in
`each'
from c:/program files/ruby/lib/ruby/site_ruby/1.8/watir.rb:2944:in
`select_item_in_select_list'
from c:/program files/ruby/lib/ruby/site_ruby/1.8/watir.rb:2925:in
`select'
from ConfigurationCaptureFilter.rb:16
---------------------------
Is this known issues?
Please let me know if you need more info.
Thanks and Regards,
Manish
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general