# Ruby\\Watir Hangs if the browser is not loaded completely

**URL:** <https://www.ruby-forum.com/t/ruby-watir-hangs-if-the-browser-is-not-loaded-completely/120880>\
**Category:** Ruby\
**Created:** [November 21, 2007, 12:30pm UTC](https://www.ruby-forum.com/t/ruby-watir-hangs-if-the-browser-is-not-loaded-completely/120880 "2007-11-21T12:30:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishwanath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/0ea827/32.png) [@vishwanath](https://www.ruby-forum.com/u/vishwanath)\
**Post date:** [November 21, 2007, 12:30pm UTC](https://www.ruby-forum.com/t/ruby-watir-hangs-if-the-browser-is-not-loaded-completely/120880/1 "2007-11-21T12:30:37Z")

</div>

Hi all,

The watir just hangs up looking for page to download completely.  
I want the test suite to continue with next test case if page does not  
get downloaded within specified time.

Is there any way by which We can accomplish this?

Help in this regard would be greatly appreciated.

Sample Code:

require ‘watir’  
include Watir  
@ie = IE.new  
#----\> The script gets hanged up with below stmt in case browser is not

# loaded completely

@ie.goto(‘[http://vodafone.in](http://vodafone.in)’)  
@ie.bring\_to\_front()  
@ie.maximize()

Even the statement below doesn’t work here  
@ie.wait(10)

Thanks  
Vishwanath U.

---

<div class="post-metadata">

**Author:** ![vishwanath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/0ea827/32.png) [@vishwanath](https://www.ruby-forum.com/u/vishwanath)\
**Post date:** [November 21, 2007, 12:33pm UTC](https://www.ruby-forum.com/t/ruby-watir-hangs-if-the-browser-is-not-loaded-completely/120880/2 "2007-11-21T12:33:29Z")

</div>

I haven’t used that module before. But you could just use a Timeout or  
rescue…

[http://www.ruby-doc.org/stdlib/libdoc/timeout/rdoc/index.html](http://www.ruby-doc.org/stdlib/libdoc/timeout/rdoc/index.html)

---

<div class="post-metadata">

**Author:** ![vishwanath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/0ea827/32.png) [@vishwanath](https://www.ruby-forum.com/u/vishwanath)\
**Post date:** [November 21, 2007, 12:40pm UTC](https://www.ruby-forum.com/t/ruby-watir-hangs-if-the-browser-is-not-loaded-completely/120880/3 "2007-11-21T12:40:30Z")

</div>

Lee J. wrote:

> I haven’t used that module before. But you could just use a Timeout or  
> rescue…
> 
> [http://www.ruby-doc.org/stdlib/libdoc/timeout/rdoc/index.html](http://www.ruby-doc.org/stdlib/libdoc/timeout/rdoc/index.html)

Can U explain a bit more with a sample script or so  
Because I didn’t get you how can we bypass a statement which is trying  
to wait till infinity until the page gets downloaded completely

Thanks
