New to Telerik Test Studio? Download free 30-day trial

No Tests Execute on Locked Machine

Problem

When I disconnect from and/or lock the machine that acts as my Execution Server, no scheduled tests are executed. This includes Remote Desktop Sessions that are minimized or closed. The following error may appear for tests with dialog handling steps or type and click steps, which are using SimulateRealTyping or SimulateRealClick properties enabled:

UnsupportedNonInteractiveOperationException(additional information about the exception)

or

SendInput: Failed. Win32Error:
InnerException:
System.ComponentModel.Win32Exception (0x80004005): SendInput: Failed. Win32Error:

Is it possible for tests to execute normally without requiring my account to always be logged in on that machine?

Cause

Any test that requires moving the mouse or sending key strokes requires access to the GUI session - e.g dialog handling uses both the mouse and keyboard typing. Telerik tests are not the only affected by this Windows limitation, you will find this is a general problem with any tool that performs UI testing.

Minimum Requirements for a Test Studio Execution Machine

Ensure all the following conditions are met for the server on which the tests will be executed:

  • Test agent is running as an interactive process and not as a service (you must specify a user name and password for the agent to log on).

  • There is an active logon session on the test server for the user mentioned above.

  • The test server is not locked, on standby, nor hibernated when the test executes.

  • Browser is not minimized during test execution.

Solution

As this is a common scenario we have worked out few possible ways to address the limitation.

Test Studio Built-in Options to Control the User Session

Recommended

The Test Studio Execution client provides built-in options to control the User session on the remote execution machines. Enabling both Keep Machine Awake and Reconnect to Console on Disconnect will keep the machine active and unlocked when an unattended scheduled run is triggered.

User session configuration

Tip

Execution of tests against Chrome Headless mode does not require active and unlocked session. Though, it requires a user to be logged on the machine.

Possible Workarounds

Some of our customers report success using the following workarounds:

  • Use a VNC product. With this they remotely connect to the test machine, leave the user logged on, but disconnect the VNC connection. This leaves the Windows session open and unlocked, but humans still cannot access it without reconnecting the VNC connection (which usually means re-authenticating).

  • Keep an Active Session Running on the server.

  • Set registry keys to work with a Minimized Remote Desktop Connection.

In this article