[wtr-general] Problem in setting radio button value

2011-03-24 Thread Ashu
hi,
I want to set radio button which are having the following fields(I
have searched on related posts in the forum, was unable to solve my
problem)

trtd class=nIdle Situation/tdtd class=ninput type=radio
value=0 name=idle0Text1input type=radio checked=checked
value=1 name=idle0Text2/td/tr

trtd class=nMode/tdtd class=ninput type=radio
checked=checked value=0 name=mode0Text3input type=radio
value=1 name=mode0Text4/td/tr

my automation code is
browser.radio(:name = idle0).flash
browser.radio(:value = 1).set
browser.radio(:name = mode0).flash
browser.radio(:value = 1).set

Here, automation for only the idle0 works, but automation at mode0
doesnt take place
Is there any other alternative?
Thanks!

-- 
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


Re: [wtr-general] Problem in setting radio button value

2011-03-24 Thread karim rayani
In the entire page, there are radio button which have the value property as
1. hence browser.radio(:value = 1).set in the last line is going set
the radio button with value 1 which comes first in the html structure.

I think you need some syntax like to fix the problem, by using multiple
attributes since a since attribute does not uniquely identify the object

browser.radio(:value = 1, :index = 2).set

On Thu, Mar 24, 2011 at 4:38 PM, Ashu ashay.n...@gmail.com wrote:

 hi,
 I want to set radio button which are having the following fields(I
 have searched on related posts in the forum, was unable to solve my
 problem)

 trtd class=nIdle Situation/tdtd class=ninput type=radio
 value=0 name=idle0Text1input type=radio checked=checked
 value=1 name=idle0Text2/td/tr

 trtd class=nMode/tdtd class=ninput type=radio
 checked=checked value=0 name=mode0Text3input type=radio
 value=1 name=mode0Text4/td/tr

 my automation code is
 browser.radio(:name = idle0).flash
 browser.radio(:value = 1).set
 browser.radio(:name = mode0).flash
 browser.radio(:value = 1).set

 Here, automation for only the idle0 works, but automation at mode0
 doesnt take place
 Is there any other alternative?
 Thanks!

 --
 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.comhttp://groups.google.com/group/watir-general%0awatir-general+unsubscr...@googlegroups.com


-- 
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