I am currently working on a program that is designed to validate web pages on a remote server. The program utilizes selenium RC to execute Firefox along with a series of tests, providing the ability to call arbitrary javascript. In cases where there is a failure, I would like to record the generated HTML of the page. While accessing the DOM HTML is straightforward, I am encountering difficulties in obtaining the original unaltered source code. Any assistance would be greatly appreciated. Thank you.
Just to clarify, my goal is not to retrieve the DOM, but rather the initial untouched source code as seen via Right click -> view page source. For example, if the actual HTML is:
<Html>
<body>
<table>
<tr>
<td>
fear the table data
</td>
</table>
and executing calls such as
document.documentElement.outerHTML || document.documentElement.innerHTML
or selenium.getHTMLSource()
results in <head> </head><body> <table> <tbody><tr> <td> fear the table data </td> </tr></tbody></table> </body>