How to create a Test Suite in Microsoft Test Manager (MTM) 2013? - microsoft-test-manager

Is there any way to define Test Scenarios/Suites in the MTM and relate Test Cases to that?
Thanks

I will assume these things from your question -
You want to create a "Scenario" and then add "Test Cases" Under that scenario. OR
You are talking about a "Test Case" to which you want to associate a "Test Method" / "Ordered Test" OR
You're asking about the convention
Create a "Scenario" and then add "Test Cases"
Scenario can be a new "Suite"(MTM > Contents > New > Suite) and you can
add an test case by clicking on the suite and clicking on "new" to
create a new "test case". This would add the test case under the test
suite.
Associate a "Test Case" to a "Test Method" / an "Ordered Test"
Go to Visual Studio, Team > Go To Work Item > type the id of your test
case created in MTM > GO to Associate Automation tab(the last tab) and
select the Test Method/Ordered Test you want to associate with the
Test Case > Save and Close
Convention:
You can try this link: https://msdn.microsoft.com/en-us/library/dd286659.aspx
Let me know if you're intending something else

Related

How can I re-run a unit test X-amount of times?

My problem is that my unit tests fails from time to time. Most of the times it is successful.
I would like to run it X amount of times or just repeat the test case until it fails.
What I can do is to just click on the test and rerun it once more even though it has been successful run, but that is time consuming.
I have had a look in Visual Studio in "Test Explorer" and Resharper "Unit Test Session", but I can find a smart way to rerun all test until it fails.
Is there another way?
Best Regards,
Hans
I see you mention you have ReSharper - in the Resharper unit test session window you can select the test you are interested in, then click the drop-down next to the Run button and there is a "Run Unit Tests Until Fail" option
Also, see here

Cannot edit "Register with Test Controller"

Test Agent is installed on a server. When I try to Configure the Test Agent, I am not able to edit the options in the "Register with Test Controller" part. This is checked but completely grayed out. I want to change the test Controller port but can't.
Any suggestions? I am admin.
screenshot of Test Agent configuration
Your Test Agent is part of an Environment(you can see that in your screen shot). SO if you want to change the test controller you will have to do it through "Microsoft Test Manager"(MTM). Here are the steps.
- Open MTM
- Go to "Lab Center" (its a drop down on top)
- When you select lab center, you can see "Environments" Tab. It will list all the test agents.
- Locate your test agent(by name). Open it.
- Go to Advanced Tab and change your test controller there.
- Proceed to next steps to finish the step.

How do you link a portion of code to a Test Case with MS Test Manager or TFService 2013?

I am currently using Team Foundation Service 2013. I'm going to give you an example and I want to know if it's possible:
I create an application.
if (testPassed){ Console.WriteLine("The program"); }
I want to select the code and create a test case knowing that my pass test case is related to this portion of code.
Test Case:
Step: Run the program
Expected: The program should output "The program passed!"
The Tester runs the test case and fails it because the output was "The program"
The bug shows up in "My Work" in the "Team Explorer" tab (Which it already does)
I select the test case and it automatically highlights the same code I highlighted as being related to the test case I created.
For anyone that has experience with TFService 2013 or Test Manager, how do I link code in Visual Studio 2013 to a Unit Test? This would be HUUUGE!
You can track code coverage in Microsoft Test Manager when the testers manually execute test cases. I wrote a article on this last year. It isn't exactly what you are asking for but I think it gets close. I haven't tried it in TFService so I'm not 100% sure it will work there.
http://blogs.msdn.com/b/visualstudioalm/archive/2012/11/28/code-coverage-in-microsoft-test-manager-in-visual-studio-update-1.aspx
Mike
I suggest you to link your coding test with id of workitem created in Microsoft Test Manager.
Create test case in Microsoft Test manager
Create test project in visual studio
Create test typed "Coded UI Tests"
Windows appears , select link to id Workitem (Select find button, and edit your query WIQL or enter directly id)

User cannot see TFS2010 test results in VS2010

I have a few lists of tests that I setup for a project that builds to a website. I have a bunch of unit tests and integration tests that runs before deploying the site. I have one user that clicks on the failed build in Build explorer but the Test results(that I can see-all test) that appears below that is empty.
If I click on it I can see a complete list of tests that passed as well as the test that failed. In the "Test Results" window at the bottom there is a drop down list to choose the(it looks like environment??) and when they choose "System#SERVERNAME SERVERTIME" it does not show the list that I can see if I am logged in. It seems to be a permission issue but where?
Thank you
Jack

Trace in Visual Studio Testing (Migrating from NUnit)

In NUnit, I'm used to writing Trace statements in the test, and having them show up in the trace tab of the NUnit gui.
On a new project, I'm moving to the built in Unit Testing in Visual Studio Professional Addition, which I believe is an interface to mstest.exe.
Test Code:
<TestMethod()>
Public Sub TestPagesInheritFromBasePage()
Dim webUI As Assembly = Assembly.GetAssembly(GetType(WebUI.BasePage))
Dim badPages As New List(Of String)
For Each t As Type In webUI.GetTypes()
Debug.Write(t.Name + ", ")
Trace.Write(t.Name + ", ")
If t.BaseType Is GetType(System.Web.UI.Page) Then badPages.Add(t.Name)
Next
Debug.Flush()
Trace.Flush()
If badPages.Count > 0 Then
Assert.Fail("{0}: do not inheriting from BasePage", String.Join(", ", badPages.ToArray()))
End If
End Sub
I'm getting a failure, so I know the Debug.Write and Trace.Write lines are executing.
I've read through the MSDN docs on writing these tests, and I can view the trace output if executing at the command line, via:
mstest.exe /testcontainer:mydll.dll /detail:debugtrace
However, I can not find the trace output when executing the tests directly in visual studio. Is there another preferred method of outputting information during a unit test, or am I missing an option to see trace info in visual studio?
Answer:
Both of the answers below (Console.Write and Debug.Write) worked, the results were in Test Results Detail (TestResult Pane at the bottom, right click on on Test Results and go to TestResultDetails). Also, I set Debug and Trace constants in project properties.
Try using Console.WriteLine() instead. I use that in my unit tests and it works fine - it displays text in unit test result output window.
Usually I use this method to print something in the output window of visual studio:
System.Diagnostics.Debug.WriteLine("Message");
To see the results double click on the test in the "Test Results" window (Accessed from the main menu item "Tests" >> window menu >> Test Results)
All earlier answers are actually correct but require more or less mouse-clicking.
If you would like to see the output immediately without an extra click, just add the columns Debug Trace and/or Output (StdOut) (whether you're using Debug.Write or Console.Write) to the Test Results pane through right-clicking on the test result and then 'Add/Remove Columns'.

Resources