locked
TFS - New unit tests not appearing in choose test dialog within test case associated automation information RRS feed

  • Question

  • I have a new automation test class under a new project within an existing solution and it contains a new automated unit test (there will be more unit tests added to this class).  I'm trying to associate the automated test case method to an existing test case within Visual Studio Premium 2013.

    The new test class has

    [Test Class]

    above the class name, and the new test method has:

    [TestMethod]
    [TestCategory("All")]
    [TestCategory("88041")] (this is the test case number)

    above the test method name.


    In Test Explorer I can see this new test method along with all the previously existing automated test cases within the solution, across projects and classes.

    When I open the test case work item within Visual Studio, click the "Associated Automation" link and then at the right end of the Associated test name box, click the button with an ellipsis to open the "Choose Test" dialog where I should be able to select the new test method, however I can only see a partial listing of the test methods I see in Test Explorer, and they're all from one class within another project in the same solution.

    Clearly I'm missing something somewhere but try as I might, I cannot find how to tell Visual Studio to look in this new class/build DLL to get the list of available automated test cases.  I've used both Bing and goggle as well as direct searches in MSDN but have not found an answer. Maybe I'm asking the question the wrong way, but it shouldn't be this difficult.

    Can someone provide some insight into how to accomplish this?

    Thanks!
    Mike Posluszny


    • Edited by Mike Poz Tuesday, August 26, 2014 9:52 PM
    Tuesday, August 26, 2014 9:27 PM

Answers

  • Hi Crystal,

    Thank you for pointing me in the right direction.  There was no corruption, however what I ended up figuring out was that the projects for the automation where the test methods weren't showing were missing some key entries in the <PropertyGroup> section.  Specifically these:

        <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
        <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
        <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
        <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
        <IsCodedUITest>False</IsCodedUITest>
        <TestProjectType>UnitTest</TestProjectType>

    When I added these entries to the projects in a text editor and then closed the solution, re-opened and built the solution clean, all the new tests appeared in the Associated Automation "Choose Test" dialog.

    Thank you!

    Mike Posluszny

    • Marked as answer by Mike Poz Wednesday, August 27, 2014 6:46 PM
    Wednesday, August 27, 2014 6:45 PM

All replies

  • Hi Mike,

    Generally we only need to build the test project successfully, then the test methods in that test project will be detected by a test case work item.

    For your current issue, I doubt whether the solution/the work item you used for the new test method is corrupted.

    Please create a new test case work item to associate your new test method to check whether the new work item can detect the new test method.

    Please create a new test project in a new solution, build the solution and then associate the new test method to the existing work item to check whether the new test method can be detected.

    IN addition, please restart your PC then open VS as admin to do the association. And you can try to reset your VS settings through Tools->Import and Export settings->Reset all settings->….

    What is more, you can flush the user cache for TFS and VS based on this blog:If you have problems with TFS or Visual Studio flush the user cache … or not? Maybe it can help you.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, August 27, 2014 7:15 AM
  • Hi Crystal,

    Thank you for pointing me in the right direction.  There was no corruption, however what I ended up figuring out was that the projects for the automation where the test methods weren't showing were missing some key entries in the <PropertyGroup> section.  Specifically these:

        <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
        <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
        <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
        <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
        <IsCodedUITest>False</IsCodedUITest>
        <TestProjectType>UnitTest</TestProjectType>

    When I added these entries to the projects in a text editor and then closed the solution, re-opened and built the solution clean, all the new tests appeared in the Associated Automation "Choose Test" dialog.

    Thank you!

    Mike Posluszny

    • Marked as answer by Mike Poz Wednesday, August 27, 2014 6:46 PM
    Wednesday, August 27, 2014 6:45 PM
  • Thank you, Fixed my problem!
    Friday, May 8, 2015 4:14 PM
  • Ran into this as well. Tried just the <ProjectTypeGuids> line and that fixed the issue. Test cases are now showing up in VS2013 when I click Associated Automation.

    That particular guid is the "Test" guid which represents a Test Project.

    Test                   {3AC096D0-A1C2-E12C-1390-A8335801FDAB}

    Alex

    Monday, June 15, 2015 10:39 PM