如何在量角器中截取整个页面的屏幕截图?

在 Protractor API 文档之后应该有是一种截取整个页面的方法,而不仅仅是可见的框架.事实上它应该是默认行为.

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.

takeScreenshot() 被调用时

browser.takeScreenshot().then(function (png) {
    // writing down image
});

然后在文件中保存选项 3.来自文档 - '当前帧的可见部分'.如何强制webdriver全屏截图?

Then in file is saved option 3. from documentation - 'Visible portion of current frame'. How to force webdriver to take full page screenshot?

推荐答案

chrome 上有个bug.https://bugs.chromium.org/p/chromium/issues/detail?id=45209https://bugs.chromium.org/p/chromedriver/issues/detail?id=294
更改浏览器高度后(browser.driver.manage().window().setSize(320, 2000);),Firefox 会截取整个页面,Chrome 不会.

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.

相关文章