You should be able to do something like

Browser.html()

To grab the original source.

There is also a Watir specific newsgroup somewhere around rubyforge.


-----Original Message-----
From: James Britt [mailto:james.britt / gmail.com] 
Sent: Saturday, July 08, 2006 1:33 PM
To: ruby-talk ML
Subject: Re: WAtir usage

Xavier Noria wrote:
> On Jul 8, 2006, at 19:25, junkone / rogers.com wrote:

> There you see what can be done grabbing the ie attribute of the  
> Watir::IE object, in case the wrapping interface does not address  some 
> particular need. Additionally, I have found reading watir.rb  very 
> instructive, you have a better knowledge of what you are doing  and may 
> give context and idioms.

About a year or so ago I poked around trying to get HTML from IE in 
Watir. The problem (and maybe this has changed) was that the IE object 
did not have a way to get the literal text currently in the browser; 
there was no COM 'view|source', so to speak.

What it exposed was access to IE's internal node tree, which is *not* 
what is in the browser. IE adds all sorts of things (for DHTML and such, 
as well as, I think, the various implied attributes defined in the HTML 
DTD.  Something akin to the post-schema infoset, I think.) so it is 
useless for verifying server output.  Still, it is handy in other ways; 
you can locate, say, table elements and td content and so on.

I wrote a method that did a recursive walk down the internal IE tree and 
created an XML string from it.  Contact me off-list if you would like me 
to send it to you.  It's old and may not work with the current Watir, 
but might give you some ideas.

james DOT britt AT gmail DOT com

-- 
James Britt

http://www.ruby-doc.org       - Ruby Help & Documentation
http://www.artima.com/rubycs/ - The Journal By & For Rubyists
http://www.rubystuff.com      - The Ruby Store for Ruby Stuff
http://refreshingcities.org   - Design, technology, usability


-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.10/383 - Release Date: 7/7/2006
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.10/383 - Release Date: 7/7/2006