I am all for 0-indexing (which has come up plenty of times before on this list, I think). I plan to make vapir configurable as soon as I have time to put into that, and at some point make 0-indexing the default, and at some point after that deprecate 1-indexing.
On Thu, Sep 9, 2010 at 15:57, Jarmo <[email protected]> wrote: > I think that it is a nice idea. Although if i made a suggestion to > make indexes 0-based then there were arguments against it due to the > backwards incompatibility concern. > > I like the fact that it is possible to specify arguments for the > element collections (elements(:class => "something")), because > currently it isn't (for vanilla Watir) and you'd have to use #find or > #find_all instead. > > Anyway, +1 from me. > > Jarmo > > On Thu, Sep 9, 2010 at 7:45 PM, Ethan <[email protected]> wrote: > > For vapir, I am pondering on deprecating usage of :index in a hash of > > attributes specifying an element. I'm looking to get reactions on this > idea > > from watir devs. > > Basically, when using a hash, :index is a special case and is extracted > from > > the attributes hash. I'd prefer not to have that one hash key treated > > differently from every other, and I think that the alternative I propose > > (below) is more elegant all around. > > I would replace this functionality with index being specified as a > subscript > > of element collections. That is, instead of: > > container.element(:class => 'some class', :index => 2) > > you'd do: > > container.elements(:class => 'some class')[2] > > The latter is already supported in vapir's master, though not yet > released > > as a gem (due to difficulties with some cases of subscript being > 0-indexed, > > when Array is returned, and some being 1-indexed where an element > collection > > is returned). > > Thoughts? > > -Ethan > > > > _______________________________________________ > > Wtr-development mailing list > > [email protected] > > http://rubyforge.org/mailman/listinfo/wtr-development > > > _______________________________________________ > Wtr-development mailing list > [email protected] > http://rubyforge.org/mailman/listinfo/wtr-development >
_______________________________________________ Wtr-development mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-development
