TFS Build 2013 can't select mstest - tfs

On my tfs if I select the default template (tfvstemplate.12.xaml).
I wan't to run mstest for my unittest's but i can't select a other test runner
I have installed tfs 2013 and visual studio ultimate 2013.
The selection field is just disabled

In the 2013 build template Microsoft has defaulted to the new Agile Test Runner and no longer supports the selection of the old test runner for 2013 (12.0) templates.
When you select a 2012 or 2010 build template (10.0 or 11.0), Team Build will still run using the MsTest runner. If you customize the 2013 template to use the old Run Tests activity it will still run tests using the MsTest runner. You need to run these older templates against a Team Build server that's still running Team Build 2010 or 2012.
The new Test Runner can execute MsTest based tests, but doesn't support the old Test Settings files. Instead it uses the new Run Settings files instead. The next version of TFS and Team Build will most likely drop support for the old test runner completely.

Related

Installed TFS Console 2015 and have both VS2015 and VS2013 on my VM.Need to run Tests(2013 and 2015) on Same VM

In our project we have Unit tests specific to VS2013 and VS2015.We have a requirement of using one build definition (Virtual machine) to run both VS2013 and VS2015 Tests on different timings.
I have installed on that VM Team Foundation Server 2015 Console and created one controller and 2 agents(each for specific version of visual studio).
We are using 2013 build template.
I have ran successfully 2015 UTs on that Virtual Machine(VM) but when I try to run VS2013 specific UTs it is picking up 2015 vstest.exe and throwing exception.
Is there any way to achieve this??
I tried to include MTest Activity build template.Activity is running but it is saying no tests to execute.
I even tried to run throught batch file invoke,this way it is running but through MSTest Activity it is not running scripts.Below is snapshot of TFS log for MSTEST activity
By default, TFS calls the corresponding version of VS to run tests. There is no way to specify the VS version for a test in XAML build with default build process template. You would need to customize your build process template by adding InvokeProcess activity to invoke 2013 vstest.exe to run tests.
Since you are using TFS 2015, I'd like to suggest you use new build system, which is tasks based. In new build system, you can add Visual Studio Test task to run tests. In this task, you can specify VSTest version:
Check this article for more information: https://www.visualstudio.com/en-us/docs/test/continuous-testing/getting-started/getting-started-with-continuous-testing

How to automatically get latest version from TFS server in Team Explorer 2013?

We are using Team Explorer 2013 with TFS to share test scripts in our project. But, we need all the latest scripts that have been updated before we run the test suite.
We are unable to find an option in Team Explorer 2013 as suggested in other threads for Visual Studio Development environment. How can this be achieved?
Option 1: You can build the test scripts first, as TFS will get latest version on your build agent machine by default when you queue a build.
Option 2: Run tf get command to get latest version before you run the test suite.
Get the latest version of all items in a workspace:
c:\workspace>tf get

TFS 2015 Requires Test Agent with a Certain Version

When we are trying to queue a build with some coded UI tests, TFS 2015 complains about test agent not being of the correct version.
No agent found in pool 1 which satisfies the specified demains:
Agent.Version -gtVersion 1.94.0
I've downloaded and installed the Agents for Microsoft Visual Studio 2013 Update 5, but I'm not sure if it's the latest possible version we can get.
I'm 100% pretty sure TFS sees our agent.
Is there a way to ensure we have this 1.94.0 version? And where can I find a download link for it? Or maybe, the problem is not with the version?
It's looking for a build agent which version is equal to 1.94.0 rather than the test agent version. Please download the latest build agent from your TFS web portal and configure it.
If you are running tests using Build vNext tasks and want to install agents from a local directory, you need to download Agents for Microsoft Visual Studio 2015 Update 3 - Click on "Tools for Visual Studio 2015" and then select "Agents for Visual Studio 2015" from the left navigation bar.
Or you can add a Visual Studio Test Agent Deployment task in your build step. This task will deploy “Test Agent” to all the machines and configures them automatically for the automation run.

TFS build 2015 fails to trigger coded ui tests - part of continuous integration process

We have come across an issue where TFS build fails to trigger coded UI tests, based on how the Test Settings file is specified in the build definition.
We have been unable to get CodedUI test project to run. The goal is to have it run on a separate machine (virtual machine). We have configured the test controller and agent on the VM. We have also set it to run as interactive process. When we run build it partially succeeds and the following test error is reported
The failure message returned is as below:
MsTestAdapter failed to discover tests in class ‘MVC_Test.MVCTest_CUI’ of assembly ‘C:\Builds\1\Test_COE\MVCAppFramework\bin\MVC_Test.dll’. Reason Could not load file or assembly ‘Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=12.0.0.0. Culture =neutral, PublickeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified..
Setup / Environment Details:
Visual studio 2015 ultimate
TFS server 2015
Agents for Visual studio 2015(Test Controller and Test Agents)
Test agent is installed as interactive process for Coded UI tests
Your CodedUI tests were written in the 2013 version of VS. I believe you have two options:
Install the Agents for Visual Studio 2013 on your test agent
Use binding redirects to automatically use the newer version as described in this TFS 2010 to 2015 Upgrade: CodedUI Feature Test Builds blog post
UPDATE
You could try upgrading your CodedUI DLLS to the VS2015 versions (14.0.0.0).
It cannot find the dll libraries for Version 12.0 which provided by VS2013. Install VS2013 on the test agent and then retry.

Upgraded TFS, Build/Test Controllers/Agents and VS to 2013, now CodedUI tests not executing due to missing 2012 assembly reference

We just upgraded from TFS/VS2012 to TFS/VS2013 and now no CodedUI tests can be executed as part of a build workflow. I now get the following error when running any test as part of a build workflow:
Error adding test case [<#>] to test run: Unable to load the test
container "\\.dll" or one of its dependencies.
Error details: System.IO.FileNotFoundException: Could not load file or
assembly 'Microsoft.VisualStudio.TestTools.UITesting, Version =
11.0.0.0, Culture=neutral, PublicKeyToken=' or one of its dependencies. The system cannot find the file specified.
Our setup is as follows:
TFS Server:
Windows Server 2012 Standard
TFS 2013 Update 2 (12.0.30324.0)
Visual Studios is NOT installed
Build Server (Used to create the build A):
Windows 7 Professional Service Pack 1
TFS 2013 Update 2 (12.0.30324.0)
Visual Studio Premium 2012 (11.0.50727.1)
Visual Studio Premium 2013 (12.0.21005.1)
Agents for Visual Studio 2013 (12.0.21005.1) (NOTE: These are not
used for this build/deploy/test workflow)
Build/Test Controller (Used to trigger build A on the above server, then execute the deploy/test workflow/build B):
Windows Server 2008 R2 Standard
TFS 2013 Update 2 (12.0.30324.0
Test Controller for VS2013 (12.0.21005.1)
Visual Studio Premium 2013 (12.0.21005.1)
Visual Studio Test Professional 2013 (12.0.21005.1)
Test Agent:
Windows Server 2012 Standard
Agents for Visual Studio 2013 (12.0.21005.1)
Development Environment:
Windows Server 2012 Standard
Visual Studio Premium 2013 (12.0.21005.1)
Visual Studio Test Professional 2013 (12.0.21005.1)
In our environment, Build A is the build that creates the build/setup packages. Build B is what deploys the build/setups to a lab environment and executes the tests.
I can run the tests without issue from the dev environment, on the dev
environment
I cannot run the tests via mstest cmdline from the controller
The DLL Microsoft.VisualStudio.TestTools.UITesting exists at "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies" on both the Test Controller and the Test Agent, but the version = 12.0.21005.1, not 11.0 which is what the error is complaining about
If Microsoft.VisualStudio.TestTools.UITesting version 12.0 is replaced with version 11.0 from another machine for troubleshooting purposes, the same error displays but for each of the following dll's:
Microsoft.VisualStudio.TestTools.UITest.Common
Microsoft.VisualStudio.TestTools.UITest.Extension
Microsoft.VisualStudio.QualityTools.CodedUITestFramework
Microsoft.VisualStudio.QualityTools.UnitTestFramework
After replacing all of the above version 12.0 DLL's with version 11.0 DLL's, I then get the following error when firing off Build B:
Failed to initialize the unit test extension 'urn:CodedUITest': A unit
test extension is not registered for the following attribute:
Microsoft.VisualStudio.TestTools.UITesting.CodedUITestAttribute
I've tried everything I could think of or find online to troubleshoot this issue, but I'm all out of ideas. Any suggestions on where to go from here to get my CodedUI tests running again? In theory, TFS, Build Controller/Agent, Test Controller/Agent and VS are all upgraded to 2013, so why are 2012(version 11) dll's needed?

Resources