Željko and Ivan

Both of your solutions work. The one that Željko suggested works the
best for my particular situation as I can use my spreadsheet calls
directly - that's what I was trying to accomplish. I get set or clear
from a spreadsheet.

So, this is working for me now:

 emckb.send ws.Range("k#{row}")['Value']



Thanks so much,
Darryl

On May 11, 10:14 am, "Vikas Garg" <[email protected]> wrote:
> Brown, using loop in such case will be best as you have to select from 2
> choices.
>
>
>
>
>
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
>
> On Behalf Of Darryl Brown
> Sent: Wednesday, May 11, 2011 7:39 PM
> To: Watir General
> Subject: [wtr-general] set or clear Check box with a variable
>
> Hello,
>
> Is it possible to set or clear a check box with a variable?
>
> This works -
>
> emckb = ie.checkbox(:id, 'enableSmtpEmail')
>
> emckb.set
> emckb.clear
>
> This does not work -
>
> x = 'set'
> y = 'clear'
>
> emckb.x
> emckb.y
>
> Why ?
> Using a data driven framework and getting the set or clear values from
> a data store. Should something like this work ?
>
> We have created a method that will do this but wanted to know if this
> can be accomplished in a more direct manner as described above using
> the x and y variables.
>
> This works OK
>
> def checkbox_set(box, value)
>     if value=='set'
>       box.set
>     else
>       box.clear
>     end
>   end
>
> checkbox(emckb,x)
>
> Thanks,
> Darryl
>
> --
> Before posting, please readhttp://watir.com/support. In short: search
> before you ask, be nice.
>
> [email protected]http://groups.google.com/group/watir-general
> [email protected]

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

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to