Good point as to exaclty why it was evaluating to 'true'.  .  and
yes  .exists?  is your friend.  I use it often

On Jul 7, 3:33 am, Jarmo Pertman <[email protected]> wrote:
> On Jul 6, 12:21 am, Chuck van der Linden <[email protected]> wrote:
>
> > See commented line, then below
> >    Functionally you are saying "if there is a radio button on the page
> > with an ID value of xxxx then put yes
>
> Actually this is not completely true because if you create an object
> with Watir, then the object itself is always created, e.g:
> $ie.radio(:id,"ID_OTHER_OPTION_BUTTON")
> $ie.radio(:id,"XXXXXX")
>
> both of these statements create a Watir::Radio object thus being true
> for if-statement, which means that the if statement mentioned above
> will be true always - even if there's no such radio.
>
> To check for existence, you'd have to invoke #exist?
> $ie.radio(:id,"XXXXXX").exist? # => false
>
> Just wanted to clarify :)
>
> Jarmo

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

You received this message because you are subscribed to 
http://groups.google.com/group/watir-general
To post: [email protected]
To unsubscribe: [email protected]

Reply via email to