HOW TO: Associate Automation for Test Cases in Visual Studio 2010

HOW TO: Associate Automation for Test Cases in Visual Studio 2010

Rate This
  • Comments 5

 

In 2010 version of Visual Studio one can author Test Cases and associate to the Test Cases automation if one had implemented them. While most of the Test Planning, Test Authoring etc.,. can be done from within Microsoft Test Manager (aka MTM) 2010 itself, one cannot associate automation to Test Cases from within the MTM Console itself.

image

 

One can always “Remove” the Associated Automation from MTM though. See the Remove Association button below when you open a specific Automated Test Case.

image

To associate Automation to Test Cases one has to do it from Visual Studio IDE. This is by design.

This is quite natural if you see, where the Automation (ie primarily the code responsible for Automation) is usually developed. The Automation is usually done as follows from the Visual Studio IDE and not from MTM.

a) Convert Recorded Tests into Coded UI
b) Generate Coded UI Directly from the VS (Right Mouse on a Test Project and Click Add)
c) OR as any of the other test types shown above such as Unit Tests, to Generic Tests.

 

image

 

The Automation is developed in the Visual Studio IDE. So once the Test Case is fully authored in MTM, and then saved, it gets created as a Work Item in TFS. You will then have to come to the Visual Studio IDE and open the Work Item as follows (Typically by pulling up the Work Items Node from Team Explorer and running a query to get Work Items of Type “Test Case”).

image

In the above I have used the “My Test Cases” Work Item query. Once you get the results you can go to the Test Case of interest and pull up the “Associated Automation” tab and associate the automation you developed as shown below. To do this click on the ellipses button ( … ) on the right of entry for Automated Test Name.

image

Once you do that you would be able to the see the list of possible Tests that you authored/developed in VS IDE and select from the list the appropriate test that you want to be used as the automation for the Test Case that was authored from MTM. This is therefore by design, if you wondered why you were not able to do the same – ie “Associate Automation” from the MTM.

Not directly related to the topic at hand, it is worth exploring the “TCM.EXE” tool. I am just providing the details of the TCM help screen.

image

Leave a Comment
  • Please add 8 and 4 and type the answer here:
  • Post
  • Hello Sir,

    I want to run GenericTest using TCM tool, without associating it to any build (Team Build). So that during test case execution external program or tests will be invoked.

    Please guide and suggest me.

    Thanks and Regards,

  • Hello Prashant,

    Please check this MSDN article for overview of Generic Tests. msdn.microsoft.com/.../ms182623.aspx. Once you understand that, you can create generic tests. These could then be part of the Test Cases and Test Scenarios you use in the Test Case Management tool  which we call MTM (Microsoft Test Manager).

    Regarding not associating it to any Team Build, you can always use a dummy build definition you create and then do the association against it there, if your situation is that you dont have any build to work against. But the way the MTM works AFAIK, you have to specify a Team Build for the publish to haoppen as all Test Results are stored in the TFS databases associated to a build.

    -Girish.

  • For what it's worth, it would be really nice if it were possible to associate more than one automated test case with a TFS Test Case - the number of variations (say, in making a call to a web api) can make authoring a separate test case per variation prohibitively cumbersome - in my situation the variations we expect to test are listed in the body of the TFS test case, and I would really like to be able to attach all the automated test cases that apply to that 'abstract' or 'template' TFS Test Case for tracking scenario completion

  • Hello,

    How come I do not see any tests in "Choose Test" window? I have a solution opened from TFS, and it got a number of test projects. I was able to successfully built them and have the dlls created. But, when I clicked the ellipses (...) in the Associate Automation, I don't see any tests. But, my collegue can see them!!!

    Thanks,

    Vijay

  • Hello,

    How come I do not see any tests in "Choose Test" window? I have a solution opened from TFS, and it got a number of test projects. I was able to successfully built them and have the dlls created. But, when I clicked the ellipses (...) in the Associate Automation, I don't see any tests. But, my collegue can see them!!!

    Thanks,

    Vijay

Page 1 of 1 (5 items)