# Inconsistent Modal Dialog Error on IE7 and IE8

**URL:** <https://rubytalk.org/t/inconsistent-modal-dialog-error-on-ie7-and-ie8/54954>\
**Category:** ruby-talk\
**Created:** [18 August 2009 21:20 UTC](https://rubytalk.org/t/inconsistent-modal-dialog-error-on-ie7-and-ie8/54954 "2009-08-18T21:20:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arti\_Singh1](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@Arti\_Singh1](https://rubytalk.org/u/Arti_Singh1)\
**Post date:** [18 August 2009 21:20 UTC](https://rubytalk.org/t/inconsistent-modal-dialog-error-on-ie7-and-ie8/54954/1 "2009-08-18T21:20:18Z")

</div>

has anyone seen this error before?

I get the error below when trying to open a modal dialog in IE7 and IE8  
with Watir.Now the Bizarre thing about this error is that the code works  
fine on the machines where the code was written and we are unable to  
replicate this error on those machines. We have tested this item  
successfuly in IE7 and IE8 and we have been running it for 2 months  
until we hit this snafu.

This error only happens on 2 new machines with IE7 and IE8

Code:  
$ie.modal\_dialog.frame(:index,1).span(:text,'Button').click\_no\_wait

waits=1  
30.times do  
begin  
puts TimeStr() + "Waiting For " +  
$ie.modal\_dialog.frame(:index,1.span(:id,'TestItem').text  
break  
rescue  
sleep(1)  
waits = waits + 1  
end # begin  
end#

This bit of code runs fairly well and usually exits after 5 seconds,but  
we get the error on our run machine.our loop exits after 30 secons  
without the modal window and the script just dies.

Error:

C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/modal\_dialog.rb:37:in  
`locate': Modal Dialog not found. Timeout = 2.0  
(Watir::Exception::NoMatchingWindowFoundException)  
&nbsp;&nbsp;from  
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/modal\_dialog.rb:86:in  
`initialize'  
&nbsp;&nbsp;from  
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/container.rb:186:in  
`new'  
&nbsp;&nbsp;from  
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/container.rb:186:in  
`modal\_dialog'

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
