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.
这篇关于如何在量角器中截取整个页面的屏幕截图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在量角器中截取整个页面的屏幕截图?
- 400或500级别的HTTP响应 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
