History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: WTR-221
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Bret Pettichord
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Watir

Get the text from a frame [patch]

Created: 18/Jun/08 02:00 PM   Updated: 13/Aug/08 04:04 PM
Component/s: FireWatir
Affects Version/s: Future
Fix Version/s: 1.6.0

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
Paul Rogers on the firewatir list:

try this

class Frame
    def url
        locate
        jssh_socket.send("#{DOCUMENT_VAR}.URL;\n", 0)
        window_url = read_socket()
        return window_url
    end
    def text
        assert_exists
        get_frame_text
    end
end

class Element
     def get_frame_text
           jssh_socket.send("var htmlelem =
#{DOCUMENT_VAR}.getElementsByTagName('html')[0]; htmlelem.textContent;
\n", 0)
           result = read_socket()
           return result
        end
end



jst add these lines after your require 'firewatir' line

Paul

On May 26, 6:58 am, MarioRuiz <ma...@betware.com> wrote:
> > A full example:
> >
> > require 'firewatir'
> > require 'watir'
> > ie=Watir::IE.new()
> > ff=FireWatir::Firefox.new()
> > url="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.


 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.