# Automating Modal dialog close

**URL:** <https://rubytalk.org/t/automating-modal-dialog-close/46283>\
**Category:** ruby-talk\
**Created:** [5 May 2008 09:13 UTC](https://rubytalk.org/t/automating-modal-dialog-close/46283 "2008-05-05T09:13:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Devabrat\_Kumar](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@Devabrat\_Kumar](https://rubytalk.org/u/Devabrat_Kumar)\
**Post date:** [5 May 2008 09:13 UTC](https://rubytalk.org/t/automating-modal-dialog-close/46283/1 "2008-05-05T09:13:52Z")

</div>

Hi

When we click Move/Copy button on Outlook webaccess through watir ,Ruby  
then we get a Move/Copy Web Dialog

While it is open i cannot work on the main browser window so I could  
know that it is Modal

Now when I am trying to close it using any of these approaches

&nbsp;&nbsp;1) xyz=@ie.close\_modal()

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OR

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2) ie3=Watir::IE.attach(:title,'Move/Copy Item');  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ie3.close()  
With either of the two approches the script waits at this point in the  
code forever

It doesnt give any error but the Dialog Box is not closed and the script  
waits forever  
ANY SOLUTION ???  
–regards  
[Devabrat.Kumar@citrix.com](mailto:Devabrat.Kumar@citrix.com)

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

---

<div class="post-metadata">

**Author:** ![Jan\_Svitok](https://avatars.discourse-cdn.com/v4/letter/j/cab0a1/32.png) [@Jan\_Svitok](https://rubytalk.org/u/Jan_Svitok)\
**Post date:** [5 May 2008 09:42 UTC](https://rubytalk.org/t/automating-modal-dialog-close/46283/2 "2008-05-05T09:42:02Z")

</div>

AutoIt [AutoIt Scripting Language - AutoIt](http://www.autoitscript.com/autoit3/)  
either create a standalone script that closes the dialog, or use  
autoit dll to control it from ruby.

> **···**
>
> On Mon, May 5, 2008 at 11:13 AM, Devabrat Kumar \<devabratkumarhere@gmail.com\> wrote:
> 
> > Hi
> > 
> > When we click Move/Copy button on Outlook webaccess through watir ,Ruby  
> > then we get a Move/Copy Web Dialog
> > 
> > While it is open i cannot work on the main browser window so I could  
> > know that it is Modal
> > 
> > Now when I am trying to close it using any of these approaches
> > 
> > &nbsp;&nbsp;1) xyz=@ie.close\_modal()
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OR
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2) ie3=Watir::IE.attach(:title,'Move/Copy Item');  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ie3.close()  
> > With either of the two approches the script waits at this point in the  
> > code forever
> > 
> > It doesnt give any error but the Dialog Box is not closed and the script  
> > waits forever  
> > ANY SOLUTION ???  
> > --regards  
> > Devabrat.Kumar@citrix.com

---

<div class="post-metadata">

**Author:** ![Devabrat\_Kumar](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@Devabrat\_Kumar](https://rubytalk.org/u/Devabrat_Kumar)\
**Post date:** [5 May 2008 09:46 UTC](https://rubytalk.org/t/automating-modal-dialog-close/46283/3 "2008-05-05T09:46:13Z")

</div>

Thanks

Jano Svitok wrote:

> **···**
>
> > On Mon, May 5, 2008 at 11:13 AM, Devabrat Kumar \> \<devabratkumarhere@gmail.com\> wrote:
> > 
> > > &nbsp;&nbsp;1) xyz=@ie.close\_modal()  
> > > ANY SOLUTION ???  
> > > --regards  
> > > Devabrat.Kumar@citrix.com
> > 
> > AutoIt [AutoIt Scripting Language - AutoIt](http://www.autoitscript.com/autoit3/)  
> > either create a standalone script that closes the dialog, or use  
> > autoit dll to control it from ruby.
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
