What is the exact code when you load the Watir and open up a browser
too?

The Watir.options line should be right after require "watir" and it
also depends of the code you're using to create/attach browser
instance.

If you're not using Watir::Browser, but use Watir::IE instead then you
should use Watir::IE.zero_based_indexing = false instead.

Jarmo

On Aug 26, 6:00 pm, George Wiley <[email protected]> wrote:
> I ran across an issue with Ruby 1.9.2, Watir 2.01 and compatibility with
> older versions without zero based indexing.
>
> I'm running on Win7, IE8. I have a page with 5 radio buttons with the below
> option set in my code.
>
> Watir.options[:zero_based_indexing] = false
>
> Here is my code:
>
> ie.radios[5].click
> ie.radios[4].click
> ie.radios[3].click
> ie.radios[2].click
> ie.radios[1].click
>
> This does not work. I get an error for index 5. I assumed that my old code
> would be able to run in the zero based indexing environment with the above
> option set.
>
> This code works fine:
>
> ie.radios[4].click
> ie.radios[3].click
> ie.radios[2].click
> ie.radios[1].click
> ie.radios[0].click   # zero based indexing
>
> Is this the way it is supposed to work for radio buttons?

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