# Watir: how to get the url in a frame

**URL:** <https://rubytalk.org/t/watir-how-to-get-the-url-in-a-frame/42799>\
**Category:** ruby-talk\
**Created:** [6 December 2007 15:27 UTC](https://rubytalk.org/t/watir-how-to-get-the-url-in-a-frame/42799 "2007-12-06T15:27:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mario\_Ruiz](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@Mario\_Ruiz](https://rubytalk.org/u/Mario_Ruiz)\
**Post date:** [6 December 2007 15:27 UTC](https://rubytalk.org/t/watir-how-to-get-the-url-in-a-frame/42799/1 "2007-12-06T15:27:00Z")

</div>

I'm using this code:

class GiveMe(frame)  
def initialize  
&nbsp;&nbsp;@frameURL=frame.url()

&nbsp;&nbsp;&nbsp;&nbsp;a few operations with this data

&nbsp;&nbsp;&nbsp;return result  
end  
end

nav=Watir::IE.new()  
nav.goto("[http://es-aas.com/customers/info/ettem.do](http://es-aas.com/customers/info/ettem.do)")

isok=GiveMe.new(nav.frame("top").frame("data"))  
...  
isok=GiveMe.new(nav.frame("main"))  
...  
isok=GiveMe.new(nav)  
...

This is working only for the last case  
How can I get the url of a frame?

Thanks in advance.

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

---

<div class="post-metadata">

**Author:** ![Mario\_Ruiz](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@Mario\_Ruiz](https://rubytalk.org/u/Mario_Ruiz)\
**Post date:** [10 December 2007 09:50 UTC](https://rubytalk.org/t/watir-how-to-get-the-url-in-a-frame/42799/2 "2007-12-10T09:50:25Z")

</div>

No ideas?

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