0
votes

I am attempting to use Visual Studio to associate a generic test with a TFS test case, so that we can run the generic in our automated regression suite. From docs, it looks like this used to be possible with older versions of Visual Studio and TFS. We are using:

  • Visual Studio 2017 Enterprise
  • TFS 2015 on-premise

The generic runs fine locally. I can associate C# test methods from the same solution / project to TFS test cases fine. But on the generic test, the option to Associate to Test Case is greyed out:

Generic test context menu, with "Associate to Test Case" disabled.

The test project builds just fine. What am I missing? About to attempt associating via tcm.exe or via TFS API, if I can't fix this, but I thought I'd see if there's a way in VS first.

1
Is there any update for this issue? Feel free to let me know if the answer could give you some help. Just a reminder of this.Kevin Lu-MSFT

1 Answers

1
votes

Associate to Test Case is greyed out in Visual Studio 2017.

Based on my test, I could reproduce this situation in Visual Studio 2017.

But it could work as expected in Visual Studio 2019. Not sure the root cause of this issue.

I try the same steps in Visual Studio 2019. And it shows different test structures. It could work fine.

Visual Studio 2019

Workaround1:

Upgrade the Visual Studio 2017 to Visual Studio 2019.

Workaround2:

On the other hand, if you want to connect the test case in Visual Studio 2017, you could try the following steps.

Step1: Navigate to Tools->Options->Work item. And select the Visual Studio Option.

enter image description here

Step2: Connect the TFS2015 in Team explore. And select the query (contain the test case).

Step3: Open the test case in Visual Studio and navigate to ASSOCIATED AUTOMATION tab.

You could click ... to select the test .

enter image description here

Then the generic test could be linked to test case.

enter image description here

For more information, you could refer to this doc.

Hope this helps.