简体   繁体   中英

How to take an OS level screen capture using ruby selenium webdriver

I know selenium has an option to take a screen capture of a webpage using

@driver.save_screenshot("image.png")  

but is there a function to take an OS level screen capture? with the browser header, background etc.

I would try to do this without using selenium. Selenium/Webdriver really only interacts with the browser. It's not meant to perform OS level functions.

I'm not a ruby user, but I found this with a quick Google search: https://github.com/jarmo/win32screenshot If you are on windows, this seems like it might work.

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