2

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.

  • Please share the code of screenshot capturing. Also if RDP is connected, were you able to get screenshots without issues? – Sham Sep 25 '14 at 07:14

1 Answers1

2

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:

Community
  • 1
  • 1
David Gausmann
  • 1,570
  • 16
  • 20
  • I get: Could not connect sessionID 0 to sessionname console, Error code 5 Error [5]:Access is denied. – kwoxer May 20 '21 at 20:14