简体   繁体   中英

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)

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 uses its own display driver, which doesn't pass draw commands if the session is in a disconnected state.

Instead you could keep the RDP connection open. To allow to minimize the RDP client you may add the following registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client\

Add there a new DWORD named "RemoteDesktop_SuppressWhenMinimized" with the value "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. (That will insure that the screen isn't locked). - Nicolas Voron

References:

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