I'm trying to take 2 screenshot from a website - One before an injection into the site, and one after.
Problem is - when I try to take the first screenshot after all the assets were loaded (and before I inject my script) - it won't create the screenshot from inside the onInitialized function.. any clue why?
page.onInitialized = function () {
page.render('e1.png');
page.evaluate(function () {
<here i'm injectingo the page>
});
};
Also - how can I compare between the 2 screenshots with resemble js? I installed the package with npm, and i'm running the test with phantomjs, so what is the way to save the screenshot created via phantomjs into variables and then compre with resemble.js? I'll be glad to see a code which is working for my need. Thank you very much!!