# Watir: How to return a Watir::IE object for an existing IE?

**URL:** <https://www.ruby-forum.com/t/watir-how-to-return-a-watir-ie-object-for-an-existing-ie/137685>\
**Category:** Ruby\
**Created:** [May 15, 2008, 9:48am UTC](https://www.ruby-forum.com/t/watir-how-to-return-a-watir-ie-object-for-an-existing-ie/137685 "2008-05-15T09:48:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anukulsinghal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/dbc845/32.png) [@anukulsinghal](https://www.ruby-forum.com/u/anukulsinghal)\
**Post date:** [May 15, 2008, 9:48am UTC](https://www.ruby-forum.com/t/watir-how-to-return-a-watir-ie-object-for-an-existing-ie/137685/1 "2008-05-15T09:48:41Z")

</div>

Hi,

I just wanted to know what code would be used to return a Watir::IE  
object for an existing IE window. Can anyone help in this regard?

Thanks,  
Anukul

---

<div class="post-metadata">

**Author:** ![anukulsinghal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/dbc845/32.png) [@anukulsinghal](https://www.ruby-forum.com/u/anukulsinghal)\
**Post date:** [May 15, 2008, 6:57pm UTC](https://www.ruby-forum.com/t/watir-how-to-return-a-watir-ie-object-for-an-existing-ie/137685/2 "2008-05-15T18:57:02Z")

</div>

Anukul S. wrote:

> Hi,
> 
> I just wanted to know what code would be used to return a Watir::IE  
> object for an existing IE window. Can anyone help in this regard?
> 
> Thanks,  
> Anukul

require ‘watir’

browser = Watir::IE.attach(:title, //) # you could also specify a title  
or partial title by regex

There’s more information about Watir on our site:  
[http://wtr.rubyforge.org/documentation.html](http://wtr.rubyforge.org/documentation.html)

as well as Watir google group that you might want to post to for  
specific questions.

[http://wtr.rubyforge.org/community.html](http://wtr.rubyforge.org/community.html)

-Charley
