Bret Pettichord wrote:
Specifically, I propose that where you currently do this:
while not ($ie.link(:text,"Second").exists?)
  sleep 0.5
end
$ie.link(:text,"Second").click
You would instead just do this
$ie.link(:text,"Second").click
And you would implicitly get the polling behavior that had been explicit. The proposal is to change all the element methods, except (perhaps) "exists?".

It seems to me that "exists?" is a separate case. We should consider it separately.

Do we have agreement on the usefulness of the proposal, if no change is made to exists?

Bret
My question is: Do we take anything useful away by making $ie.link always do this? If we have a configurable default timeout that can be set to 0 I think we're fine.

Here's what I'd like to see:
1) Add a global configurable default time to wait for pages to load. I'd propose leaving this at 0 seconds by default and letting people up it intentionally.
2) Add a new optional argument on $ie.link, where I can choose to override that default:

    $ie.link_wait(:text,"Second").click  ## continues to do what it's always done, unless I have deliberately changed my default page wait. (Or if I've set my default page wait to (for example) 600 seconds, it'll wait for up to 10 minutes on each page before giving up.)

    $ie.link(:text,"Second", 30).click  ## would wait up to 30 seconds for the page to load before erroring out, regardless of my default page wait time.

...btw, I don't have a strong opinion on whether the default wait time would be 0 or non-0. The question for me is which is least surprising scenario: Someone who expects the script to error when a page doesn't return quickly, or someone who expects the script to wait patiently while something happens prior to page load.

Jeff
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to