[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


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

2011-03-24 Thread Ashu
Well thanks for the reply Karim.
I did manage to solve the problem using
browser.radios.each {|m|
if m.name == cc_output_mode0  m.value == 1
m.set
end
}
:-)

On Mar 24, 4:22 pm, karim rayani karim.ray...@gmail.com wrote:
 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 readhttp://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...

-- 
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] Re: Problem in setting radio button value

2011-03-24 Thread karim rayani
you have done the same thing, using multiple attributes as there are 2
button which have value as 1. :)



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

 Well thanks for the reply Karim.
 I did manage to solve the problem using
 browser.radios.each {|m|
if m.name == cc_output_mode0  m.value == 1
m.set
 end
 }
 :-)

 On Mar 24, 4:22 pm, karim rayani karim.ray...@gmail.com wrote:
  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 readhttp://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
 http://groups.google.com/group/watir-general%0Awatir-general+unsubscr...

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