This is where you need to use a little natural Ruby. For example:

filename = 'output.xml', 'w').write browser.html

Another useful style is:, 'w') do |output|
        output.puts "Whatever I want to put in the file."

Hope this helps.


On 18 May 2009, at 18:46, Natasha wrote:

> Hello All,
> Apologies for an unambiguous subject line.
> Following is a scenario in my test:
> 1. On a particular page, we have a hyperlink.
> 2. When you click on that hyperlink, it opens up an XML document in
> the same window
> 3. I wanted to copy the contents and save that XML file on disk. I can
> do that manually by clicking on File menu option of the browser and
> selecting Save As option.
> Is there a way I can manully save the output of the entire page as an
> XML file?
> Thanks,
> Natasha
> >

You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to
Before posting, please read the following guidelines:
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to