[ 
http://jira.openqa.org/browse/WTR-452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=19851#action_19851
 ] 

Jarmo Pertman commented on WTR-452:
-----------------------------------

By using Timeout module was also one of my first tries to implement the timeout 
but for some unknown reason it didn't work for me. I tried to set it to 1 
second, but it didn't work consistently and seemed to still block forever 
sometimes. Even using the debugger i couldn't sort it out... I'm not sure 
what's the reason behind it, but i've used more manual way of checking the 
timeout. Here's the commit 
http://github.com/jarmo/WatirSplash/commit/ec6e5e4d72b9edfe11ed25c7137512d673aebe91

I don't like the fact that when timeout occurs in your example then it is just 
"puts"-ed to the screen and then refreshed the browser (what happens if it will 
stay blocking?). I feel it more natural when an Exception will be raised so 
it's also easy to see from the testing report that something strange happened 
rather than some anomalies in the test report caused by the possible state 
change due to refresh.

Also, what happens if last request was POST? IE will open up a dialog window 
asking if user wants to repost if using refresh and block forever?

That's also why i'd prefer raising an Exception.

I can also see that you have also used readystate interactive down below 
(although not in the upper loop). If you haven't seen yet then i've reported a 
bug and a patch for the upper loop with actual reproducable case @ 
http://jira.openqa.org/browse/WTR-446

(PS! it seems that your patch also worked with a timeout of 0.1 seconds - it 
might have something to do with the other changed code also - e.g. some loops 
are defined differently and so on... or maybe i was just lucky, i don't know)

Jarmo

> adding timeout to #wait
> -----------------------
>
>                 Key: WTR-452
>                 URL: http://jira.openqa.org/browse/WTR-452
>             Project: Watir
>          Issue Type: Improvement
>          Components: Wait
>    Affects Versions: 1.6.5
>         Environment: all envs
>            Reporter: Jarmo Pertman
>         Attachments: wait_patch.rb
>
>
> Currently it is possible that Watir will block forever in it's #wait method 
> under some circumstances. There are questions once in a while in the group 
> also about the timeout of Watir.
> Unfortunately currently there is no timeout!
> I have a proposal to add a timeout. And make it hardcoded - let's say 5 
> minutes. Why hardcoded? Because i think that if your page is unable to load 
> in 5 minutes then your page is broken and should be fixed/changed anyway. 
> This would be a small indicator to the developers and testers that they 
> shouldn't waste so much time of their lives for waiting some bad application 
> to render a page.
> Charley proposed to create an issue and let people to vote (not downvote) it!
> So, what do you guys think about making Watir a little as an Opinionated 
> Software as Rails tries to be?
> (PS, if your page loads more than 5 minutes and you cannot get yourself 
> together to fix it or tell your developers to fix it and you really need to 
> have longer timeouts, then you can always monkey-patch #wait. We're talking 
> about Ruby where everything is possible, remember?)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.openqa.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

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

Reply via email to