简体   繁体   English

使用watir-webdriver在折叠屏幕截图上方

[英]Above the fold screenshots using watir-webdriver

I'm using watir-webdriver for screenshots, and now it is only giving me full site screenshots. 我正在使用watir-webdriver来截屏,现在只给了我完整的网站截屏。 How can I see just what is above the fold? 我如何才能看到首屏以外的内容?

Current code: 当前代码:

driver = Webdriver::UserAgent.driver(:browser => :firefox, :agent => :iphone, :orientation => ;landscape)
browser = Watir::Browser.new driver
browser.goto "http://forefathersgroup.com"
browser.driver.save_screenshot "forefathers.png

There is no way to get only visible part of the page using watir-webdriver, because selenium, which is used in this library does not provide such functionality. 使用watir-webdriver无法仅获得页面的可见部分,因为此库中使用的硒不提供此类功能。

So one of possible solutions is crop a screenshot after its creation 因此,可能的解决方案之一是在创建屏幕快照后对其进行裁剪

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM