I'm writing this off the top of my head so the syntax might be a bit off...


options = select_list(:id, "availableColumnsSelectBox").getAllContents
index = options.index("Sector")
options.select(options[index])

That should work...although probably not the best way :)

Shao







On 7/12/05, Tuyet Cong-Ton-Nu <[EMAIL PROTECTED]> wrote:
> 
> 
> In this select box, there are 2 items that have the word Sector in it:
> 
>  
> 
> 1) GICS Sector
> 
> 2) Sector
> 
>  
> 
> I am trying to select the item "Sector", but I keep getting "GICS Sector"
> because it appears before "Sector".
> 
> I think \A should match the beginning of a string but this doesn't seem to
> work.  Any ideas?
> 
>  
> 
> irb(main):009:0>
> ie.frame("customizeRemoteContent").select_list(:id,
> "availableColumnsSelectBox").select(/\ASector/)
> 
> Watir::Exception::NoValueFoundException: Selectbox was
> found, but didn't find item with text of (?-mix:\ASector)
> 
>         from
> C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3306:in
> `select_item_in_select_list'
> 
>         from
> C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3284:in `each'
> 
>         from
> C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3284:in
> `select_item_in_select_list'
> 
>         from
> C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3261:in `select'
> 
>         from (irb):9
> 
>         from :0
> _______________________________________________
> 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

Reply via email to