Open pranavparikh opened 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
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