Coded UI Test not able to interact with the desktop

If you are running into the following error, Please read the options to enable Coded UI Tests on a remote machine.

Error calling Initialization method for test class NewTitlesPush.NewTitlesPush: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: Automation engine is unable to playback the test because it is not able to interact with the desktop.  This could happen if the computer running the test is locked or it’s remote session window is minimized.


For the UI tests, the active desktop session has to be opened. We have faced this issue and we have couple of solutions

1. Open a Hyper-V session onto the machine where the UI Tests are running. You can minimize the hyper-V window and the tests will still run fine.

2. If you are running tests in a Lab Environment created from Microsoft Test Manager, Run the tests and open LEViewer[Lab Environment Viewer] to keep the desktop session active.

3. Enable AutoLogon on the machine where the tests are running and restart the machine. Then you don't need to do remote desktop -





Comments (2)

  1. technos says:

    There are cases where even on physical machines, this error message will show up. Would you know how to fix this? Any hotfix available?

  2. Become an option says:

    Why does not add this as a testsetting in visual studio, to mark if you want to run tests with out using Remote desktop connection?

Skip to main content