[Wtr-general] Proposal for supporting multiple attributes

Bret Pettichord bret at pettichord.com
Tue Jun 6 18:54:07 EDT 2006


I am planning to add multiple attribute support to Watir. For example:

  ie.div(:class => "MenuItem", :text => "Pulverize").click

The old syntax would continue to be supported.

  ie.div(:text, "Pulverize").click

Moreover, you could now also specify single attributes using this new
"hash" syntax. Thus:

  ie.div(:text => "Pulverize").click

These would allow any types of attributes to be mixed. In the case of
":index", the index would apply last. Therefore

  ie.div(:class => "MenuItem", :index => 3).click

Would click the third div on the page whose class=MenuItem. In effect,
set of attributes would have an :index of 1 unless something else were
specified.

Comments?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060606/9547e7f2/attachment.html 


More information about the Wtr-general mailing list