I just had a case where I wanted to check needed fields, for example
there's a form something like this:
<form action='blah'>
  <input name='field1'>
  <input name='field2'>
  <input type='submit'>
</form>

now if i press submit, then the form will have an error message
something like "all necessary fields need to be filled", and the form
will be something like this:
<form action='blah'>
  <input name='field1'>
  <span class='error'>*</span>
  <input name='field2'>
  <span class='error'>*</span>
  <input type='submit'>
</form>

So i wanted to make some helper method in my test to check if those *
marks are there and saw that there is a method called :before?
and :after? and thought that i could use them:
def field_needed?(el1, el2)
  span(:after? => el1, :before? => el2).exists?
end

That actually seemed to work, but i wanted to make it even better and
implement :between? to Watir::Element, when I noticed that it doesn't
seem to work with at least text_fields (didn't try anything else, but
i'm also suspecting that the problem seem to exist with
Watir::InputElement).

On Jan 21, 10:56 pm, Charley Baker <[email protected]> wrote:
> I've never actually used :after? or :before? either. We are still reporting
> issues in Jira, which does need some maintenance soon.
>
> Charley Baker

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general

Reply via email to