[英]Watin taking black Screenshots when RDP is disconnected
We are using WatiN - 2.1.0 to take a screenshot when an test fails.when RDP is in disconnected mode on all screenshot's are recorded black(using IE9) 我们使用WatiN-2.1.0在测试失败时拍摄屏幕截图。当RDP处于断开模式时,所有屏幕截图均记录为黑色(使用IE9)
on Server we are running 在我们正在运行的服务器上
windows server 2008 VM
internet explorer 9
The screenshots recorded on test failure are all black. 测试失败时记录的屏幕截图全为黑色。
It is not possible to take screenshots of disconnected RDP sessions. 无法获取断开的RDP会话的屏幕截图。 RDP uses its own display driver, which doesn't pass draw commands if the session is in a disconnected state.
RDP使用其自己的显示驱动程序,如果会话处于断开状态,则该驱动程序不会传递绘图命令。
Instead you could keep the RDP connection open. 相反,您可以保持RDP连接打开。 To allow to minimize the RDP client you may add the following registry key:
为了使RDP客户端最小化,您可以添加以下注册表项:
HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client\
Add there a new DWORD named "RemoteDesktop_SuppressWhenMinimized" with the value "2". 在那里添加一个新的DWORD,名称为“ RemoteDesktop_SuppressWhenMinimized”,其值为“ 2”。
Another solution is it to move the session to the console: 另一个解决方案是将会话移至控制台:
To prevent this, don't use the 'x' to close the remote connection, but use %windir%\\system32\\tscon.exe 0 /dest:console instead.
为避免这种情况,请不要使用“ x”关闭远程连接,而应使用%windir%\\ system32 \\ tscon.exe 0 / dest:console。 (That will insure that the screen isn't locked).
(这将确保屏幕未锁定)。 - Nicolas Voron
-尼古拉斯·沃隆(Nicolas Voron)
References: 参考文献:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.