watir-webdriver black 截图 [英] watir-webdriver black screenshots

查看:32
本文介绍了watir-webdriver black 截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 watir-webdriver 浏览我的网站并在不同浏览器中抓取屏幕截图.

I'm using watir-webdriver to navigate around my website and grab screenshots in different browsers.

有时在 IE 中截取的屏幕截图大小合适,但颜色完全为黑色.同时运行的 Firefox 测试看起来不错.

Sometimes the screenshots taken in IE turn out the right size, but colored entirely black. The firefox tests that get run at the same time look fine.

browser.driver.save_screenshot(screenshot_dir)

一旦我将桌面远程连接到运行测试的计算机,IE 屏幕截图看起来又正常了.离开远程桌面后,IE 屏幕截图再次变黑.

Once I remote desktop to the computer running the tests the IE screenshots look okay again. A little bit after leaving remote desktop the IE screenshots go black again.

我正在 ec2 上运行的 Windows Server 实例上运行这些测试.

I'm running these tests on a instance of Windows Server running on ec2.

推荐答案

根据您的评论,远程访问机器可以暂时解决问题...禁用该框上的屏幕保护程序.我不确定 IE 和 FF 上的屏幕截图功能有何不同(如果有的话),但值得花时间测试更改.

Based on your comment that remotely accessing the machine resolves the problem for a little while... disable the screensaver on that box. I'm not sure how (if at all) the screenshot functions on IE and FF differ, but it's worth the time it would take to test the change.

我仍然觉得它与 Windows/电源设置相关,因为您登录到该框似乎有效果,但我不知道还有什么具体可能是.我在 vvv 下面尝试了一个程序化的方法.

I still feel like it's windows/power setting related as you logging into the box appears to have an effect, but I don't know what else specifically that could be. I tried a programmatic approach below vvv.

这篇关于watir-webdriver black 截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆