On Feb 24, 10:28 pm, Rajiv Nanduani <rajivkumarnandv...@gmail.com>
wrote:
> Hi All,
>
> I am facing a problem with watir for list box object. I have to extrach the
> value of select item in list box instead of text value Like..
>
> <select size="1" name="phone_type">
>             <option value="">- Select One ------------------</option>
>             <option selected="" value="M">Mobile Phone</option>
>             <option value="O">Daytime Phone</option>
>             <option value="H">Evening Phone</option>
>         </select>
>
> Here i need the value property value like M , O , H
>
> please suggest how to get this value using watir/ruby


The way to get this value is as follows:

1) access the RDoc file for Watir  (http://rdoc.info/gems/watir/1.7.0/
frames)

2) look up the "selectlist" element

3) scan the documentation for selectlist until you notice that there's
a specific example given in this section
http://rdoc.info/gems/watir/1.7.0/Watir/SelectList:option
 which shows how to get the value given the displayed text.

4) write code based on the example given.

5) if that fails, ask on the watir group, providing sample of the HTML
(check, already did that), the code you tried, and the results you got
including any error messages.


The RDoc is your friend, many of the answers you seek are waiting
there for you to find, if you but search.

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

Reply via email to