简体   繁体   English

如何使用Ruby Selenium Webdriver进行操作系统级别的屏幕截图

[英]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. Selenium / Webdriver实际上仅与浏览器交互。 It's not meant to perform OS level functions. 这并不意味着要执行OS级功能。

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. 我不是红宝石用户,但是我通过Google的快速搜索找到了它: https : //github.com/jarmo/win32screenshot如果您在Windows上,这似乎可以工作。

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

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