Last week, we saw how to troubleshoot SSL issues.
Similarly, during automation, one might have to do a remote desktop connection (RDC) to multiple machines and there are chances of minimizing or closing the RDC connections. In this blog post, we discuss the solutions to problems with native elements if the RDC is minimised or closed.
Scenario 1: Minimised Remote Desktop Connection
When tests are executed on a remote machine using Remote Desktop Connection and the RDC window remains minimised, native events (including taking screenshots) fail to work.
To fix this, one needs to add registry keys on the client machine from which the Remote Desktop Connection is made.
NOTE that these keys are to be modified on the client and not the remote machine.
Please be careful while changing the registry entries.
- Launch the Windows Registry as appropriate on your Windows machine
- For 32-bit Windows, find the registry key:
HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client
- For 64 bit Windows, find the registry key:
HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Terminal Server Client
- Create a DWORD value with the name RemoteDesktop_SuppressWhenMinimized with value 2.
- Run the tests.
Now native events should work well with a minimised Remote Desktop Connection.
Scenario 2: Closed Remote Desktop Connection
Sometimes users would want to open a Remote Desktop Connection, start running the tests on the remote machine, and close off the connection from the client while the tests are running.
In this case, native events (including taking screenshots) fail to work.
To work around this, please do the following instead of closing the remote desktop connection directly.
- Create a batch file on the Remote machine’s Desktop (For example: “disconnect.bat”).
- Type the following line in the file –
tscon %sessionname% /dest:console
and save it.
- Start off the tests on the Remote machine.
- Do not close the Remote Desktop Connection from the client directly.
- Instead, double click on the batch file. The session will be closed by the remote desktop.
Now native events should work well with the closed Remote Desktop Connection.
Scenario 3: Right Click > Paste (Clipboard) missing in RDP (RDC)
Even though you have ensured that Clipboard is checked and available during the remote session, when you do a right click after a copy, the paste option might be disabled.
All you need to do is to kill the clipboard process and restart it again! You can do so by running the following command from the windows run command (Windows Key + R) or cmd (on the remote machine):
Taskkill.exe /im rdpclip.exe
The command above will kill RDP Clip Monitor process, and then you can restart the process again by running the following command:
It should start the process again and the clipboard should start working again now
Refer the following link for more information:
Hope this post gave you information about troubleshooting RDC issues. Feel free to let us know if you face any other issues by sending an email to support [AT] sahipro [DOT] com
We will cover those in the upcoming posts.