Search code examples
c#visual-studio-2010.net-4.0coded-ui-tests

Is it possible to run Coded UI tests without having to connect via remote desktop?


I'm attempting to automate Coded UI tests.

My test controller launches the tests on a remote test server, which I normally access via a Remote Desktop connection.

Is it possible to run the Coded UI tests without having to connect via remote desktop?

Currently, the tests only run when I have connected via Remote Desktop, and the window must be open. When I close the Remote Desktop session, the tests do not run.

If it isn't possible to run coded UI tests without remote desktop, how can I automate connecting via remote desktop?

Thanks


Solution

  • The easiest solution to this problem was simply to enable auto-logon on my test environment (there are a variety of ways of doing this depending on OS).

    With auto-logon enabled, when I restart the test environment (using the 'shutdown.exe /r' command, which can be scripted), the test environment loads back up with an active, logged on session, and so the tests can run successfully.

    For my nightly test automation, I enabled auto-logon on my test environment and scheduled a restart prior to test execution.

    I have had no issues with this method - and it means I don't have to connect via Remote Desktop.