YahooArchive / arrow

FE Test framework designed to promote TDD
http://yahoo.github.io/arrow/arrow_intro.html
BSD 3-Clause "New" or "Revised" License
55 stars 59 forks source link

Arrow HTML source is not current #257

Open pranavparikh opened 10 years ago

pranavparikh commented 10 years ago

Currently, when Arrow takes a "screenshot" of a failure, the HTML that it outputs comes from this code:

webdriver.getPageSource().then(function(src) { fs.writeFileSync(testName + "-" + count + ".html", src); callback(); });

However, this always represents the state of the DOM when the page first loaded, not the current state (which would be more useful). I'm not certain how to get at the exact full current DOM, but I did get this far:

webdriver.findElement(webdriver.By.tagName("html")).getAttribute("innerHTML").then(function (src) { fs.writeFileSync(testName + "-" + count + ".html", src); callback() });

This at least gets the innerHTML of the element, which should contain at least the part of the page you care about.

Am I completely off-base here, or is this something worth looking into?

-Andy