Re: [Wtr-general] Syntax for relative attributes

2007-01-09 Thread Bret Pettichord
Christian Kreutzer wrote: On 12/22/06, Bret Pettichord [EMAIL PROTECTED] wrote: So we have consistently urged people to wrap their watir expressions in methods rather than assign them to global variables. This makes it easy to reuse them, and ensure that a correct rebinding occurs on each

Re: [Wtr-general] Syntax for relative attributes

2007-01-09 Thread John Lolis
I think what bret said is $my_button = $ie.button(:id, 'foo') is a bad idea. It may be better to do something like... def my_button() return( $ie.button(:id, 'foo') ) end while my_string = $ie.text could be fine, though you could still do def my_string() return( $ie.text ) end ... i think

Re: [Wtr-general] Syntax for relative attributes

2007-01-08 Thread Christian Kreutzer
On 12/22/06, Bret Pettichord [EMAIL PROTECTED] wrote: So we have consistently urged people to wrap their watir expressions in methods rather than assign them to global variables. This makes it easy to reuse them, and ensure that a correct rebinding occurs on each reuse. Also, as i have been

Re: [Wtr-general] Syntax for relative attributes

2007-01-08 Thread Chris McMahon
the watir expressions are now wrapped in methods but i cant see how the object binding could be different from using global vars. I hope someone can enlighten me on this

Re: [Wtr-general] Syntax for relative attributes

2006-12-22 Thread Bret Pettichord
John Lolis wrote: A second, slightly related question. Regardless of how you do it, i'm wondering whats going on behind the scenes. If you do headline = $ie.div(:text, 'Pragmatic Version Control') link = $ie.link(:class = 'addtocart', :after? = headline) Is headline now

Re: [Wtr-general] Syntax for relative attributes

2006-12-21 Thread John Lolis
link = ie.div(:text, 'Pragmatic Version Control').after.link(:class, addtocard') I think this is less intuitive and it would be somewhat harder to implement. That's why i came up with the other proposal, above. Thats actually the first way I thought of it too. A second, slightly

Re: [Wtr-general] Syntax for relative attributes

2006-12-20 Thread Christian Kreutzer
i can't see much difference between :after? and :is_after?. i would read both versions as link after headline Christian On 12/20/06, Bret Pettichord [EMAIL PROTECTED] wrote: Yi, Lawrence wrote: I would see that as link after headline. That was my original intention. Is this clearer?

Re: [Wtr-general] Syntax for relative attributes

2006-12-20 Thread Željko Filipin
On 12/20/06, Bret Pettichord [EMAIL PROTECTED] wrote: link = $ie.link(:class = 'addtocart', :is_after? = headline) This would make sense to me (no question mark) link = $ie.link(:class = 'addtocart', :after = headline) By convention, methods that answer questions (i.e. Array#empty?

Re: [Wtr-general] Syntax for relative attributes

2006-12-20 Thread Bret Pettichord
Željko Filipin wrote: This would make sense to me (no question mark) link = $ie.link(:class = 'addtocart', :after = headline) By convention, methods that answer questions (i.e. Array#empty? returns *true* if the receiver is empty) end in question marks.

Re: [Wtr-general] Syntax for relative attributes

2006-12-20 Thread John Lolis
headline = $ie.div(:text, 'Pragmatic Version Control') link = $ie.link(:class = 'addtocart', :after? = headline) Is this saying you want the link that comes after headline? Is there a before? :) *if* thats the case, my only problem with it is that it seems to not follow the standard syntax of

Re: [Wtr-general] Syntax for relative attributes

2006-12-20 Thread Bret Pettichord
John Lolis wrote: headline = $ie.div(:text, 'Pragmatic Version Control') link = $ie.link(:class = 'addtocart', :after? = headline) Is this saying you want the link that comes after headline? Is there a before? :) Yes, there would also be a 'before' option, plus some others *if* thats

[Wtr-general] Syntax for relative attributes

2006-12-19 Thread Bret Pettichord
I am in the process of adding a new feature to Watir and have a question. Consider this code: headline = $ie.div(:text, 'Pragmatic Version Control') link = $ie.link(:class = 'addtocart', :after? = headline) Would you assume that link was after headline, or headline after link? I can

Re: [Wtr-general] Syntax for relative attributes

2006-12-19 Thread Phlip
Bret Pettichord wrote: I am in the process of adding a new feature to Watir and have a question. Consider this code: headline = $ie.div(:text, 'Pragmatic Version Control') link = $ie.link(:class = 'addtocart', :after? = headline) Would you assume that link was after headline, or

Re: [Wtr-general] Syntax for relative attributes

2006-12-19 Thread Yi, Lawrence
] Syntax for relative attributes I am in the process of adding a new feature to Watir and have a question. Consider this code: headline = $ie.div(:text, 'Pragmatic Version Control') link = $ie.link(:class = 'addtocart', :after? = headline) Would you assume that link was after headline

Re: [Wtr-general] Syntax for relative attributes

2006-12-19 Thread Bret Pettichord
Yi, Lawrence wrote: I would see that as link after headline. That was my original intention. Is this clearer? link = $ie.link(:class = 'addtocart', :is_after? = headline) Bret ___ Wtr-general mailing list Wtr-general@rubyforge.org