T-Plan Ltd Home
T-Plan Robot Enterprise 4.4.7 Doc Collection
29/01/19

RDP Connection


Remote Desktop Protocol (RDP) is a proprietary protocol developed by Microsoft. RDP servers are built into Windows operating systems. This technology is in MS Windows also known as Terminal Services and the server is also called Terminal Server. There are RDP server implementations also for Unix and OS X. Testing over the RDP protocol was introduced by T-Plan Robot Enterprise v4.3:

RDP on Windows

MS Windows supports the RDP connection as follows:

RDP on other systems

On other systems you have to install and start an RDP server. Known implementations:
There are several 3rd party solutions supporting the RDP connection for non-Windows implementations. For non-Windows environments the RDP functionality that Robot support may vary from Windows based systems.

For example, Oracle VirtualBox supports RDP connection to its virtual machines (VM). Robot can connect to such a VM and automate it, however the clipboard transfer and drive redirection support is limited. Also some systems running in VM don't set the correct screen size, and you may have to force the correct screen size, through the connection parameters on the Robot side.


RDP features

Robot 4.4.4 introduced support of clipboard transfer between the local and the remote systems. It is based on synchronization of the local and remote clipboards. If you plan having multiple RDP connections on a single Robot machine you have to implement some kind of lock to avoid parallel clipboard updates from two competing scripts.
// Save the clip contents as text to the CLIP variable
Var CLIP="{_SERVER_CLIPBOARD_CONTENT}"
// Set the clipboard content to "Hello world"
Var _SERVER_CLIPBOARD_CONTENT="Hello world!"
Robot 4.4.4 also accepts most of the FreeRDP CLI options which allow to modify the connection parameters and set on additional features. Examples:
/drive:Z,C:\MyData
Drive redirection is subject to the support from the remote system and it doesn't have to work on all environments. It is recommended to use a file path with maximum permissions.

The CLI options may be defined:

Var _RDP_OPTIONS="/drive:Z,C:\MyData"
Connect rdp://myserver

Connecting
To connect to the RDP from a test script use the Connect command (TPR scripts) or the connect() method (Java test scripts). The argument URL must be in form of  "rdp://<host_or_IP>".

For example, the following command/method call will connect you to the remote desktop using the RDP connection:

TPR test scripts:     Connect rdp://<address>?user=<user>&password=<passwd>
Java test scripts:    connect("rdp://<address>?user=<user>&password=<passwd>");

The URL may be also used together with the -c/--connect CLI option to establish the connection on the Robot start up.

IMPORTANT: The RDP system must use the US English keyboard layout. Other layouts are currently not supported and test scripts employing the Type and Press command will type wrong characters. This limitation will be addressed in a future Robot release.