Connecting to TFS from Microsoft Test Manager aka MTM
This question has come up a few times, so I thought I might as well blog. How to connect to Team Foundation Server from the Test Management console.
You are connecting from MTM to TFS and you get the following error.
Unable to connect to the server <YourServerName>. Check that the server name is correct and that you have access to the server.
First check if your server version is 2010 or not. You cant use MTM to connect to a 2008 TFS Server. Assuming it is a 2010 Server, then you can carry out some of the steps below to get connected from MTM to TFS 2010.
Say for instance this is your TFS instance that you had connected to from Visual Studio Team Explorer Client.
So you go to the MTM Console and try to add the Server as follows, and click on Add.
You get this response, wondering what you did wrong.
Then you add the “TFS” at the end as follows:
And voila you are connected. And it lists you the Project Collection to pick and the Team Project to pick underneath it as follows:
Click on the project you want to work on, and it should take you to the screen and you are on your way.
Sometimes you will get errors not connecting to the TFS Server. Most often this is due to wrong Server URL you specified. In such cases also try the method below.
The other way to connect from MTM to TFS: MTM command line
If you go the MTM installation folder, you can connect to TFS directly by using the command line invocation of MTM.
The easiest way to get to the correct Server URL that MTM needs is to go the Team Explorer in Visual Studio and copy and paste from there. See below for the Server Url in the properties window from where you C&P.
MTM is installed in the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE folder, if you installed on the C:\ drive. So go to that in a command prompt and invoke MTM as follows: (contains two / switches /s for Server and /p for project – your might vary based on your URL and Project Collection)
BuzzNet Tags: MTM TFS connecting command line
This should take you to the screen for selecting a Test Plan if you already had one, or to add a new one if non existed for the Team Project that you had chosen, and you should be good to go.
Not only that, once you got the command-line working, you can convert it into a Desktop Shortcut and or a Taskbar item and always keep it ready to launch if you work with MTM a lot.
In my case the string I used for shortcut is exactly the same as in the command window. Please see below:
Basically you have to fill up the /s and the /p parameter arguments to MTM.