none
Not able to associate the Test case to the Test method From Unit Test Project using selenium web driver RRS feed

  • Question

  • Hi ,

    We are using Unit test project for UI automation using 

    I can execute test from visual studio Test >Test Explore > Select the Test and Click on Run.

    I am not able to Associate the Test case to the Test method From Unit Test Project  which were developed in Unit Test project.

    We are using Visual Studio 2017 Professional version in this we are able to see the option ‘Associate to Test case’ in disable mode ( Test > Test Explore > Right click on any  unit Test method  > Associate to Test case ).

    Please suggest the solution for associating the Test cases.

    thanks 

    Satish

    Thursday, March 1, 2018 5:37 AM

All replies

  • Hi Satish,

    Welcome to the MSDN forum.

    I test your issue use Visual Studio Professional 2017 version 15.5.7, I can repro your issue in my side.

    Please remove following assemblies under project References.

    Microsoft.VisualStudio.TestPlatform.TestFramework

    Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions

    Then, add “Microsoft.VisualStudio.QualityTools.UnitTestFramework” assembly, rebuild the solution.

    After above method, the option “Associate to Test Case” is display highlighting.

    Someone has submitted a feedback, you could take a look.

    https://developercommunity.visualstudio.com/content/problem/80374/cant-associate-net-framework-unit-test-to-test-cas.html

    Regards,

    Judyzh


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Judy ZhuY Thursday, March 1, 2018 8:32 AM
    • Marked as answer by Vegi Satish Saturday, March 3, 2018 12:52 AM
    • Unmarked as answer by Vegi Satish Saturday, March 3, 2018 3:38 AM
    Thursday, March 1, 2018 8:28 AM
  • Hi Vegi Satish,

    Any update of your issue?

    I saw you mark my reply as an answer, and then you unmark it.

    What happened? Please share the latest information of this issue, I will do what I can to help you.

    Thanks for your understanding.

    Regards,

    Judyzh


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, March 6, 2018 1:48 AM
  • Hi Vegi Satish,

    There’s a workaround to add test method into test case, please refer to it:

    Please open the project test case, go to tab “ASSOCIATED AUTOMATION”, choose the test method to add in “Choose Test” dialog box.

    More information, please reference:

    https://msdn.microsoft.com/en-us/library/dd380741.aspx?f=255&MSPPError=-2147217396

    Regards,

    Judyzh


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Judy ZhuY Monday, March 12, 2018 9:18 AM
    Monday, March 12, 2018 8:08 AM
  • Hi,

    I have tried this option, but still 'Associate to Test case' is disabled for me. Below are my framework details.

    Microsoft Visual Studio Enterprise 2019 [Version 16.0.1]

    Target Framework: .NET Framework 4.6.1

    Output Type: Class Library

    Project Type: BDD with SpecFlow 2.X, Selenium Web driver, Spec Run

    Unit Test Provide = SpecRun

    For Unit Test methods Associate to Test Case is enabled and it is disabled only for SpecFlow scenarios. There are few existing test cases which are associated with VSTS 2015 version, I am facing this issue with VSTS 2017 and VSTS 2019. We are using Azure DevOps [on cloud].

    Here, test methods are not Unit tests and they are SpecFlow scenarios. Can you please Suggest me some thing to fix this issue.


    • Edited by Anusha Edara Monday, November 4, 2019 12:49 PM addedmore information
    • Proposed as answer by shaz_san Thursday, December 5, 2019 8:22 PM
    • Unproposed as answer by shaz_san Thursday, December 5, 2019 8:22 PM
    • Proposed as answer by shaz_san Thursday, December 5, 2019 8:22 PM
    • Unproposed as answer by shaz_san Thursday, December 5, 2019 8:22 PM
    Monday, November 4, 2019 12:26 PM
  • This issue may happen while going through this option is Associate To Test Case  may be disabled by default.

    So try below steps to fix this.

    • Check if the Visual studio is connected to Azure/Git project in Teams explorer.

    • Check if there is any Visual studio updates are pending and do update if any.
    • Change the Mstest reference as below

    [Microsoft.VisualStudio.TestPlatform.TestFramework] to [Microsoft.VisualStudio.QualityTools.UnitTestFramework]

    trying out these one by one will get the option enabled.

    For more details  , Visit here https://automatefuture.blogspot.com/2019/12/associating-mstest-test-script-with.html

    Thursday, December 5, 2019 8:23 PM