Two things.

1. We are now tracking bugs and feature requests in jira at openqa 
(http://jira.openqa.org), not at Rubyforge. Please put all requests and 
bug reports there. (We are trying to close down the old ones at 
Rubyforge to avoid confusion.)

2. If you have a solution, like Lonny, please attach it to the ticket. 
That way it makes it much easier for one of our committers to include 
the fix in Watir.

With your help, Watir can be better.

Bret

Lonny Eachus wrote:
>
> In the meantime Ben, Ruby is very cool in that you can extend it 
> whenever you want. So if you still need to do this while waiting for 
> the feature to be included in Watir, you can just extend it yourself 
> by adding this code to your program:
>
>   class Watir::SelectList
>     def getSelectedValues
>       assert_exists
>       returnArray = []
>       @o.each do |thisItem|
>         if thisItem.selected
>           returnArray << thisItem.value
>         end
>       end
>       return returnArray 
>     end
>   end
>
> (The keyword 'return' is not strictly necessary.)
>
> Use it exactly as you would use getSelectedItems:
>   ie.select_list(:name, "thename").getSelectedValues[0]
>   
> Hope that helps.
>
>
> Lonny Eachus
> ===========
>
>> Subject:
>> [Wtr-general] [ wtr-Feature Requests-5289 ] Asserting that a 
>> particular option is selected in a drop down
>> From:
>> <[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]>
>> Date:
>> Thu, 3 Aug 2006 12:52:35 -0400 (EDT)
>>
>>
>> Feature Requests item #5289, was opened at 2006-08-03 12:52
>> You can respond by visiting: 
>> http://rubyforge.org/tracker/?func=detail&atid=490&aid=5289&group_id=104 
>> <http://rubyforge.org/tracker/?func=detail&atid=490&aid=5289&group_id=104>
>>
>> Category: General
>> Group: None
>> Status: Open
>> Resolution: None
>> Priority: 3
>> Submitted By: Ben Mills (benmills)
>> Assigned to: Nobody (None)
>> Summary: Asserting that a particular option is selected in a drop down
>>
>> Initial Comment:
>> I have a situation where I'm using the querystring of the URL to preselect 
>> an option in a drop down.  I want to assert the correct option is selected.  
>> It seems like the best way for me to get the selected option is:
>>
>> ie.select_list(:name, "thename").getSelectedItems()[0]
>>
>> I thought that this would return an object that would allow me to get either 
>> the text or the value of the option.  However, it seems to just return the 
>> text as a string.  I really want to be able to get the value of the selected 
>> option (the text could change and make the text fail, but the value is 
>> fixed).
>>
>> In the API documentation I noticed the Watir::OptionAccess object which 
>> allows access to both the value and the text, but I can't see any way to get 
>> this object.
>>
>> Maybe I'm missing something.
>>
>> Thanks,
>> Ben Mills
>>   
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Wtr-general mailing list
> Wtr-general@rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to