Disconnecting from Remote Desktop while executing automated tests

Explains how to restore a remote desktop session to the local console of the remote computer while you are executing automated tests on the remote computer.

Problem

When using Remote Desktop to connect to a remote computer, terminating Remote Desktop locks out the remote computer, displaying the logon screen. In the locked mode, TestArchitect is unable to continue to interact with the AUT’s GUI, so any currently running automated tests might fail.

Solution

To avoid this problem, use the tscon command to disconnect from Remote Desktop. tscon returns the control to the original local session on the remote computer, overcoming the logon screen. All programs on the remote computer continue running normally, including your running automated tests.

To disconnect from Remote Desktop, run the following command on the remote computer (in the Remote Desktop window) as an administrator:

%windir%\System32\tscon.exe <SessionID> /dest:console

where <SessionID> is the ID of your current Remote Desktop session, for example, 0. You will see the Your remote desktop session has ended message, and the Remote Desktop client will be terminated. But all programs and automated tests on the remote computer will continue to run normally.

重要: 
If this command does not work, because the ID of the remote desktop session to which you want to connect is not correct. Try changing the number 0 (tscon.exe 0 /dest:console) to the number 1, and if it still does not work, keep incrementing the session ID until your remote desktop is released.

You can also automate the above disconnection step using a batch file or using the execute command built-in action.


Copyright © 2024 LogiGear Corporation. All rights reserved. LogiGearはLogiGear Corporationの登録商標であり、Action Based TestingおよびTestArchitectはLogiGear Corporationの商標です。ここに記載されているその他の商標は、各所有者の財産です。

LogiGear Corporation

1730 S. Amphlett Blvd. Suite 200, San Mateo, CA 94402

Tel: +1 (650) 572-1400