How to take screenshot of entire page in Protractor?(如何在量角器中截取整个页面的屏幕截图?)
问题描述
在 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.
这篇关于如何在量角器中截取整个页面的屏幕截图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在量角器中截取整个页面的屏幕截图?


基础教程推荐
- html表格如何通过更改悬停边框来突出显示列? 2022-01-01
- Chart.js 在线性图表上拖动点 2022-01-01
- 如何使用JIT在顺风css中使用布局变体? 2022-01-01
- 直接将值设置为滑块 2022-01-01
- Electron 将 Node.js 和 Chromium 上下文结合起来意味着 2022-01-01
- 用于 Twitter 小部件宽度的 HTML/CSS 2022-01-01
- 如何使用TypeScrip将固定承诺数组中的项设置为可选 2022-01-01
- 我可以在浏览器中与Babel一起使用ES模块,而不捆绑我的代码吗? 2022-01-01
- Vue 3 – <过渡>渲染不能动画的非元素根节点 2022-01-01
- 自定义 XMLHttpRequest.prototype.open 2022-01-01