Windows Store apps cannot be run from a service or non interactive process

574 Views Asked by At

When I try to run my Windows Phone 10 Test on a machine using vstest.console.exe, the emulator starts as expected and the test completes successfully.

Now, when I set-up a build machine and kick off a TFS vNext build from a remote machine, the test fails with the following error:

Error: Could not start test run for the tests for Windows Phone app: Unit tests for Windows Store apps cannot be run from a service or non interactive process. Please run unit tests from an interactive process..

Researching online, I found that this is an expected behavior to enable Session-0 isolation.

  • What is the workaround/solution to be able to run Windows Phone Tests on a remote build machine successfully?

Thanks.

1

There are 1 best solutions below

3
On BEST ANSWER

By default your build agent runs as a service. This means that it runs completely in the background and doesn't interact with the UI.

To run Coded UI Tests (or any other test that interacts with the UI), you need to run the build agent in Interactive Mode. This means the build agent launches as an actual program that you can see running. Running in this mode, the agent can interact with the UI.

You can edit the properties of an existing build agent through the TFS Admin Console and enable the 'Run the Service interactively'. After restarting the machine, the agent is now capable of running UI tests.

See Enable your build agent to run unit tests for more information.


Update

To install the vNext Agent as a service you first need a build machine. This can be any machine that's connected to the internet. On this machine you install the required tools to build your application (such as Visual Studio, Azure SDK etc.).

You then download the Agent installation from: https://.visualstudio.com/_admin/_AgentPool

Unzip the file, go to an elevated command prompt and run ConfigureAgent.cmd. You need to supply all the required values or accept the default ones. The step that's important for your is highlighted in the following screenshot:

vNext installation screenshot

You need to select No to make sure that the Agent doesn't run as a service. After that, finish the configuration. Make sure to use this Agent for your build.