That might be the case indeed.

Jarmo

On Sep 6, 11:46 pm, brett sykes <brettcsy...@gmail.com> wrote:
> Hey Jarmo,
>
> This sounds like it is caused by (http://jira.openqa.org/browse/WTR-486).
> His HTML could essentially do something like this:
>
> <html>
>         <table id=a_table>
>             <tr onclick="alert('row 1')"><td>row 1</td>
>             <tr onclick="alert('row 2')"><td>row 2</td>
>             <tr onclick="alert('row 3')"><td>row 3</td>
>         </table>
> </html>
>
> In which case using the released version of Watir 2.0.1 with code like this:
> b.table(:id, 'a_table').rows[2].click
>
> would fire the alert for the row 1 and not row 3.
>
> And using:
> b.table(:id, 'a_table').row(:index, 2).click
>
> would correctly fire the alert for row 3 (as George has described in the
> latest email).
>
>  Brett
>
>
>
>
>
>
>
> On Tue, Sep 6, 2011 at 2:56 PM, George Wiley <george.wi...@gmail.com> wrote:
> > I tried it both ways with the same results. I found that it works when
> > I use the syntax below. I have to change my code in all my old scripts
> > but it will run with old and new versions of Watir with this change.
>
> > use:
>
> > ie.table(:id, 'Menu').row(:index => 1).click()  # this syntax works
> > when the switch is set
>
> > instead of:
>
> > ie.table(:id, 'Menu').rows[1].click()  # it would be nice if this
> > worked but it does not
>
> > On Sep 6, 2:25 pm, Jarmo Pertman <jarm...@gmail.com> wrote:
> > > Does Watir::Browser.new work instead of Watir::IE.new?
>
> > > Jarmo
>
> > > On Sep 2, 6:45 pm, George Wiley <george.wi...@gmail.com> wrote:
>
> > > > Here is my test code. Maybe you can see what my problem is. The below
> > > > code works in 2.0.1 if IDX value is 0 but fails if IDX is 1.
>
> > > > require 'watir'
> > > > Watir::IE.zero_based_indexing = false
> > > > # Watir.options[:zero_based_indexing] = false
>
> > > > test_site = 'http://mysite.com'
>
> > > > ie = Watir::IE.new()
> > > > ie.goto(test_site)
>
> > > > IDX = 1  # This works in 1.6.2 but does not work in 2.0.1 with either
> > > > of the zero_based_indexing switches set above.
>
> > > > ie.table(:id, 'Menu').rows[IDX].click()
>
> > > > On Aug 27, 7:22 am, Jarmo Pertman <jarm...@gmail.com> wrote:
>
> > > > > 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 <george.wi...@gmail.com> 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?- Hide
> > quoted text -
>
> > > > > - Show quoted text -
>
> > > > On Aug 27, 7:22 am, Jarmo Pertman <jarm...@gmail.com> wrote:
>
> > > > > 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 <george.wi...@gmail.com> 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?- Hide
> > quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -
>
> > --
> > 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.com

Reply via email to