Following Protractor API documentation there should be a way to take screenshot of entire page, not only visible frame. In fact it should be default behaviour.
When takeScreenshot()
is called like
browser.takeScreenshot().then(function (png) {
// writing down image
});
Then in file is saved option 3. from documentation - 'Visible portion of current frame'. How to force webdriver to take full page screenshot?
takeScreenshot(). then(function (png) { // writing down image }); Then in file is saved option 3.
This is a hack, but you can set the height of the browser in your onPrepare
to be 2000
pixels or some other high value:
browser.driver.manage().window().setSize(320, 2000);
there is a bug on chrome.
https://bugs.chromium.org/p/chromium/issues/detail?id=45209
https://bugs.chromium.org/p/chromedriver/issues/detail?id=294
After change browser height(browser.driver.manage().window().setSize(320, 2000);
), Firefox will take entire page screenshot, but not Chrome.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With