简体   繁体   中英

Above the fold screenshots using watir-webdriver

I'm using watir-webdriver for screenshots, and now it is only giving me full site screenshots. 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.

So one of possible solutions is crop a screenshot after its creation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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