简体   繁体   English

RDP断开连接时,Watin拍摄黑色屏幕截图

[英]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.

相关问题 截屏软件在未连接时不截屏 (RDP) - Screenshot software not taking screenshots while not connected (RDP) 使用Windows API获取黑色屏幕截图 - Getting Black Screenshots with Windows API 自动截取程序窗口的截图 - Automatically taking screenshots of program window 是否有一种简单的方法来自动截取屏幕截图? - Is there an easy way to automate the taking of screenshots? 重置 windows 防火墙规则后与 RDP 断开连接 - Disconnected from RDP after resetting windows firewall rules Windows Server - 使用默认的rdp许可证2,同时断开许多RDP会话会使RD服务繁忙 - Windows Server - Using default rdp license of 2 while having many RDP sessions disconnected makes the RD services busy 在Windows构建服务器上使用Internet Explorer驱动程序截屏时出现黑屏 - Black screen when taking screenshot with Internet Explorer driver on Windows build server 检测用户何时截取我的程序的屏幕截图 - Detect when users take screenshots of my program 作为 Windows 服务运行时创建屏幕截图 - Create screenshots when running as Windows Service 远程桌面断开连接时,GetForegroundWindow返回Null - GetForegroundWindow returns Null when remote desktop is disconnected
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM