[Wtr-general] Automation annoyingness

Bret Pettichord bret at pettichord.com
Wed Jun 7 20:31:47 EDT 2006


On 6/7/06, Lillis, Dara <dara.lillis at kiodex.com> wrote:
>
> while not ($ie.link(:text,"Second").exists?)
>   sleep 0.5
> end
> $ie.link(:text,"Second").click


This is what i do as well.

I think the remaining question is whether Watir should do this
automatically. I've actually coded this directly and tested it and it works.
It's only a couple of lines of code.

The only complication is that if you do this on every call, you need to make
darn sure you put a limit on how long you will poll for the existance of an
object. What happens if the page changes and the second page no longer has a
link called "Second"? Dara's solution would hang indefinitely, which is a
bad thing for a test to do.

So that means adding a timeout and then providing a means for users to
configure the timeout for their own tests.

Should we build this into Watir?

The main drawback is that every time there is a failure to find an object,
Watir will wait the timeout interval, before actually raising the error. So
it could make tests slower, especially when there are lots of errors. On the
other hand, you could just set the timeout to 0, and then it would work the
way it does today.

Comments?

Bret
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/61fd435f/attachment.html 


More information about the Wtr-general mailing list