1
votes

I've installed VS 2017 Enterprise on both my Build server and Test server with the Coded UI Testing components installed, but my "Run Functional Tests" TF Build task still fails to resolve the reference to the CodedUITestFramework assembly. All the assemblies are present on both VMs in the "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PublicAssemblies" folder.

I've tried the following that hasn't worked!

1) Added the PublicAssemblies folder PATH environment variable

2) Added the assemblies to the GAC

Here is the error displayed in the console while running the TF Build/Release process:

MSTestAdapter failed to discover tests in class 'CodedUITestProject1.CodedUITest1' of assembly 'c:\Test\CodedUITestProject1.dll'. Reason Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified..

I'm at loss for how to enable my test DLL to resolve this assembly reference?

2
Could you manually run the Code UI test in remote VM with VS to see if it works?PatrickLu-MSFT
@Patrick-MSFT Yes I successfully created a simple CUIT test by remoting to that VM. I copied this project into source control and hooked it into the Release process where the solution is compiled, test agent deployed but the execution task still fails when resolving this assembly.KJK

2 Answers

0
votes

To run Coded UI test, you have to configure the test agent to interact with the Desktop and build agent running as interactive Mode.

First please make sure you have enable it in Agent Configuration of Visual Studio Test Agent Deployment task.

Besides to get more info for troubleshooting, you could also enable debug mode in the build definition.


Update

  • TFS 2017 RTM – TFS 2017 RTM shipped with ‘Visual Studio Test Agent Deployment’ (v1) and ‘Run Functional Tests’ tasks that can be used in the Team Build / Release Management scenarios. These tasks use the Agents for Visual Studio 2015 Update 3 package. As such, the tasks in their current form can be used for running tests built using Visual Studio 2015 and Visual Studio 2013. They cannot run tests built using Visual Studio 2017.

  • TFS 2017 Update 1 – TFS 2017 Update 1 shipped with ‘Visual Studio Test Agent Deployment’ (v2) and ‘Run Functional Tests’ tasks that can be used in the Team Build / Release Management scenarios. The test agent deployment task has the ability to specify which Agent version (2015 or 2017) should be deployed. Based on the selection, the appropriate agent will get deployed and can run tests built using Visual Studio versions as described in the previous sections.

Source Link: Test Controller, Test Agent versions and their usage in different scenarios

0
votes

The solution turned out to be quite simple. There is a "Version" drop-down at the top right hand corner of each Task that I was unaware of. :( I needed to use "Version 2" of the VS Test Agent Deployment task so that I could properly configure it to deploy the VS 2017 Test Agent. Once this was in place, the Deploy and Run Tests tasks run immediately without error! Thanks again @Patrick-MSFT for your input along the way!