# FireWatir: get the text from a frame

**URL:** <https://www.ruby-forum.com/t/firewatir-get-the-text-from-a-frame/138665>\
**Category:** Ruby\
**Created:** [May 26, 2008, 3:08pm UTC](https://www.ruby-forum.com/t/firewatir-get-the-text-from-a-frame/138665 "2008-05-26T15:08:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcblues](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@tcblues](https://www.ruby-forum.com/u/tcblues)\
**Post date:** [May 26, 2008, 3:08pm UTC](https://www.ruby-forum.com/t/firewatir-get-the-text-from-a-frame/138665/1 "2008-05-26T15:08:40Z")

</div>

I’m trying to get the text shown in a frame using the text porperty in  
firewatir that works for a no-frame window but it doesn’t work for a  
frame…

A full example using watir and firewatir:

require ‘firewatir’  
require ‘watir’  
ie=Watir::IE.new()  
ff=FireWatir::Firefox.new()  
url=“[http://www.tlwilliams.net/NOCCC/0005/0005pFrame.html](http://www.tlwilliams.net/NOCCC/0005/0005pFrame.html)”  
frame=“menu”

ff.goto(url)  
ie.goto(url)

puts “\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* FIREFOX \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*”  
myframe=ff.frame(frame)  
puts myframe.text()

puts “\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* INTERNET EXPLORER  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*”  
myframe=ie.frame(frame)  
puts myframe.text()

ff.close()  
ie.close()

The result is:

Starting Firefox using the executable : C:\Program Files\Mozilla  
Firefox\firefox.exe  
Waiting for 2 seconds for Firefox to get started.  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* FIREFOX \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* INTERNET EXPLORER \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Web Publishing - Using Frames in HTMLFrames

\_\_5.0\_Introduction\_to\_Frames

\_\_5.1\_Using\_Frames

\_\_5.2\_Complex\_Frames

\_\_5.3\_Floating\_Frames

\_\_5.4\_References

As you can see we don’t have any text content from firewatir.

Anybody knows how to get the text… I mean not the html

Thanks.
