{"id":3863,"date":"2012-11-27T10:54:00","date_gmt":"2012-11-27T10:54:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2012\/11\/27\/integrating-existing-testing-systems-with-microsoft-test-manager-team-foundation-server-and-visual-studio\/"},"modified":"2019-02-14T17:57:53","modified_gmt":"2019-02-15T01:57:53","slug":"integrating-existing-testing-systems-with-microsoft-test-manager-team-foundation-server-and-visual-studio","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/integrating-existing-testing-systems-with-microsoft-test-manager-team-foundation-server-and-visual-studio\/","title":{"rendered":"Integrating existing testing systems with Microsoft Test Manager, Team Foundation Server and Visual Studio"},"content":{"rendered":"<p>I have been working with different partners in the testing space for the last couple of months and a frequently asked question is: <\/p>\n<blockquote>\n<p><font color=\"#9b00d3\" size=\"3\"><em>\u201cWhere do we start integrating our test tools with the Microsoft application life cycle platform?\u201d<\/em><\/font><\/p>\n<\/blockquote>\n<p>And the answer is relatively straight simple<\/p>\n<blockquote>\n<p><font color=\"#9b00d3\" size=\"3\"><em>\u201cYou need to integrate yourself into the development workflow\u2026we use Team Foundation Server for that ALM workflow engine\u201d<\/em><\/font><\/p>\n<\/blockquote>\n<p>Unfortunately simple doesn\u2019t always mean comprehensible\u2026so I typically go on to say: <\/p>\n<blockquote>\n<p><em><font color=\"#9b00d3\" size=\"3\">\u201c\u2026So that you can your tests run as part of the build process \u2013and let the development team know if the tests passed\/failed\u201d<\/font><\/em><\/p>\n<\/blockquote>\n<p>\u2026At this point the light comes on and the question usually becomes:<\/p>\n<blockquote>\n<p><font color=\"#800080\" size=\"3\"><em>\u201chow do I do that?\u201d<\/em><\/font><\/p>\n<\/blockquote>\n<p>A generalized pattern for a tool targeting a manual test team might be: <\/p>\n<ol>\n<li>File bugs from your IDE into TFS \u2013 if you can extend the existing IDE <\/li>\n<li>Create Test Cases in TFS <\/li>\n<li>Create a Tests type in Visual Studio that knows how to execute your existing tests <\/li>\n<li>Set the newly created Visual Studio Tests to be executed during the automation testing <\/li>\n<\/ol>\n<p>&#160;<\/p>\n<p>Below i list a couple of ways of achieving these steps: <\/p>\n<p><font color=\"#0000ff\" size=\"3\">Step1. File bugs from your IDE into TFS<\/font> <font size=\"3\"><font color=\"#000000\"><font color=\"#0000ff\"><\/font><\/font><\/font><\/p>\n<p>This is very straightforward and I have covered it in the post: <\/p>\n<p><a href=\"http:\/\/blogs.msdn.com\/b\/charles_sterling\/archive\/2011\/03\/24\/notepad-for-workitems-how-to-programmatically-create-workitems-in-visual-basic-for-team-foundation-server-2010.aspx\">Notepad for Workitems: how to programmatically create workitems in Visual Basic for Team Foundation Server 2010<\/a><\/p>\n<p><font color=\"#0000ff\" size=\"3\"><\/font><\/p>\n<p><font color=\"#0000ff\" size=\"3\">Step2. Create Test Cases in TFS<\/font><\/p>\n<p>This is just pretty much the same thing as the TFS Notepad \u2013 but instead of a bug it is a test case. <\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><span style=\"font-family:;color:\"><font face=\"Consolas\"><font style=\"font-size: 9.5pt\">&#160;<\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#0000ff\">static<\/font><\/span><span style=\"font-family:;color:\"> <\/span><span style=\"font-family:;color:\"><font color=\"#2b91af\">ITestManagementTeamProject<\/font><\/span><span style=\"font-family:;color:\"> GetProject(<\/span><span style=\"font-family:;color:\"><font color=\"#0000ff\">string<\/font><\/span><span style=\"font-family:;color:\"> serverUrl, <\/span><span style=\"font-family:;color:\"><font color=\"#0000ff\">string<\/font><\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\"> project)<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><span style=\"font-family:;color:\"><font face=\"Consolas\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><font style=\"font-size: 9.5pt\">{<\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#2b91af\">TeamFoundationServer<\/font><\/span><span style=\"font-family:;color:\"> tfs = <\/span><span style=\"font-family:;color:\"><font color=\"#0000ff\">new<\/font><\/span><span style=\"font-family:;color:\"> <\/span><span style=\"font-family:;color:\"><font color=\"#2b91af\">TeamFoundationServer<\/font><\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\">(serverUrl);<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#2b91af\">ITestManagementService<\/font><\/span><span style=\"font-family:;color:\"> tms = tfs.GetService&lt;<\/span><span style=\"font-family:;color:\"><font color=\"#2b91af\">ITestManagementService<\/font><\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\">&gt;();<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#0000ff\">return<\/font><\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\"> tms.GetTeamProject(project);<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><span style=\"font-family:;color:\"><font face=\"Consolas\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><font style=\"font-size: 9.5pt\">}<\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><span style=\"font-family:;color:\"><font face=\"Consolas\"><font style=\"font-size: 9.5pt\">&#160;<\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#0000ff\">private<\/font><\/span><span style=\"font-family:;color:\"> <\/span><span style=\"font-family:;color:\"><font color=\"#0000ff\">void<\/font><\/span><span style=\"font-family:;color:\"> Button_Click_1(<\/span><span style=\"font-family:;color:\"><font color=\"#0000ff\">object<\/font><\/span><span style=\"font-family:;color:\"> sender, <\/span><span style=\"font-family:;color:\"><font color=\"#2b91af\">RoutedEventArgs<\/font><\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\"> e)<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><span style=\"font-family:;color:\"><font face=\"Consolas\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><font style=\"font-size: 9.5pt\">{<\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#0000ff\">string<\/font><\/span><span style=\"font-family:;color:\"> serverurl = <\/span><span style=\"font-family:;color:\"><font color=\"#a31515\">&quot;http:\/\/localhost:8080\/tfs&quot;<\/font><\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\">;<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#0000ff\">string<\/font><\/span><span style=\"font-family:;color:\"> project = <\/span><span style=\"font-family:;color:\"><font color=\"#a31515\">&quot;Training1&quot;<\/font><\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\">;<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#2b91af\">ITestManagementTeamProject<\/font><\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\"> proj = GetProject(serverurl, project);<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#2b91af\">ITestCase<\/font><\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\"> tc = proj.TestCases.Create();<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><font style=\"font-size: 9.5pt\">tc.Title = <\/font><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#a31515\">&quot;Training1&quot;<\/font><\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\">;<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><span style=\"font-family:;color:\"><font face=\"Consolas\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><font style=\"font-size: 9.5pt\">tc.Save();<\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 10pt;line-height: 13pt\"><span style=\"font-family:;color:;line-height: 11pt\"><font face=\"Consolas\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><font style=\"font-size: 9.5pt\">}<\/font><\/font><\/span><\/p>\n<p><font color=\"#0000ff\" size=\"3\"><\/font><\/p>\n<p><font color=\"#0000ff\" size=\"3\">Step3. Create a Tests type in Visual Studio knows how to execute your existing tests<\/font><\/p>\n<p>This step is probably the most work as you will need to create a wrapper for the existing test execution engine so testers using the Microsoft test tools can interact and get the results of the test being run. <\/p>\n<p>In the example below I am just shelling out to and checking for return\u2026Hoping anything done in the wild will be a little more sophisticated than this!<\/p>\n<blockquote>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><font color=\"#0000ff\"><font style=\"font-size: 9.5pt\">Imports<\/font><\/font><\/span><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\"> System.Text<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><font color=\"#0000ff\"><font style=\"font-size: 9.5pt\">Imports<\/font><\/font><\/span><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\"> Microsoft.VisualStudio.TestTools.UnitTesting<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><span style=\"font-family:;color:\"><font face=\"Consolas\"><font style=\"font-size: 9.5pt\">&#160;<\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\">&lt;<\/font><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#2b91af\">TestClass<\/font><\/span><span style=\"font-family:;color:\">()&gt; <\/span><span style=\"font-family:;color:\"><font color=\"#0000ff\">Public<\/font><\/span><span style=\"font-family:;color:\"> <\/span><span style=\"font-family:;color:\"><font color=\"#0000ff\">Class<\/font><\/span><span style=\"font-family:;color:\"> <\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\" color=\"#2b91af\">UnitTest1<\/font><\/span><\/font><span style=\"font-family:;color:\"><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><span style=\"font-family:;color:\"><font face=\"Consolas\"><font style=\"font-size: 9.5pt\">&#160;<\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160; <\/font><\/span><font style=\"font-size: 9.5pt\">&lt;<\/font><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#2b91af\">TestMethod<\/font><\/span><span style=\"font-family:;color:\">()&gt; <\/span><span style=\"font-family:;color:\"><font color=\"#0000ff\">Public<\/font><\/span><span style=\"font-family:;color:\"> <\/span><span style=\"font-family:;color:\"><font color=\"#0000ff\">Sub<\/font><\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\"> TestMethod1()<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#0000ff\">Dim<\/font><\/span><span style=\"font-family:;color:\"> p <\/span><span style=\"font-family:;color:\"><font color=\"#0000ff\">As<\/font><\/span><span style=\"font-family:;color:\"> <\/span><span style=\"font-family:;color:\"><font color=\"#0000ff\">New<\/font><\/span><span style=\"font-family:;color:\"> System.Diagnostics.<\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\" color=\"#2b91af\">Process<\/font><\/span><\/font><span style=\"font-family:;color:\"><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\" color=\"#008000\">&#8216; \/\/ Redirect the output stream of the child process.<\/font><\/span><\/font><span style=\"font-family:;color:\"><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><font style=\"font-size: 9.5pt\">p.StartInfo.UseShellExecute = <\/font><\/span><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\" color=\"#0000ff\">False<\/font><\/span><\/font><span style=\"font-family:;color:\"><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><font style=\"font-size: 9.5pt\">p.StartInfo.RedirectStandardOutput = <\/font><\/span><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\" color=\"#0000ff\">True<\/font><\/span><\/font><span style=\"font-family:;color:\"><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><font style=\"font-size: 9.5pt\">p.StartInfo.FileName = <\/font><\/span><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\" color=\"#a31515\">&quot;c:mobiletestermobiledevicetester.exe&quot;<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\" color=\"#008000\">&#8216;\/\/ The line above just shows how you could launch ANYTHHING<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><span style=\"font-family:;color:\"><font face=\"Consolas\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><font style=\"font-size: 9.5pt\">p.Start()<\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\" color=\"#008000\">&#8216;\/\/ Do not wait for the child process to exit before<\/font><\/span><\/font><span style=\"font-family:;color:\"><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\" color=\"#008000\">&#8216;\/\/ reading to the end of its redirected stream.<\/font><\/span><\/font><span style=\"font-family:;color:\"><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\" color=\"#008000\">&#8216;\/\/ Read the output stream first and then wait.<\/font><\/span><\/font><span style=\"font-family:;color:\"><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#0000ff\">Dim<\/font><\/span><span style=\"font-family:;color:\"> output <\/span><span style=\"font-family:;color:\"><font color=\"#0000ff\">As<\/font><\/span><span style=\"font-family:;color:\"> <\/span><span style=\"font-family:;color:\"><font color=\"#0000ff\">String<\/font><\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\"> = p.StandardOutput.ReadToEnd()<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><span style=\"font-family:;color:\"><font face=\"Consolas\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><font style=\"font-size: 9.5pt\">p.WaitForExit()<\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#0000ff\">If<\/font><\/span><span style=\"font-family:;color:\"> <\/span><span style=\"font-family:;color:\"><font color=\"#0000ff\">CType<\/font><\/span><span style=\"font-family:;color:\">(output.ToString, <\/span><span style=\"font-family:;color:\"><font color=\"#0000ff\">Integer<\/font><\/span><span style=\"font-family:;color:\">) = 2 <\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\" color=\"#0000ff\">Then<\/font><\/span><\/font><span style=\"font-family:;color:\"><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#2b91af\">Assert<\/font><\/span><span style=\"font-family:;color:\">.Fail(<\/span><span style=\"font-family:;color:\"><font color=\"#a31515\">&quot;Test Failed&quot;<\/font><\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\">)<\/font><\/span><\/font><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\" color=\"#008000\">&#8216;At this point consider automatically filing a bug <\/font><\/span><\/font><span style=\"font-family:;color:\"><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\" color=\"#0000ff\">Else<\/font><\/span><\/font><span style=\"font-family:;color:\"><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/font><\/span><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#0000ff\">End<\/font><\/span><span style=\"font-family:;color:\"> <\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\" color=\"#0000ff\">If<\/font><\/span><\/font><span style=\"font-family:;color:\"><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><font face=\"Consolas\"><span style=\"font-family:;color:\"><span><font style=\"font-size: 9.5pt\">&#160;&#160;&#160; <\/font><\/span><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:\"><font color=\"#0000ff\">End<\/font><\/span><span style=\"font-family:;color:\"> <\/span><\/font><span style=\"font-family:;color:\"><font style=\"font-size: 9.5pt\" color=\"#0000ff\">Sub<\/font><\/span><\/font><span style=\"font-family:;color:\"><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 0pt;line-height: normal\"><span style=\"font-family:;color:\"><font face=\"Consolas\"><font style=\"font-size: 9.5pt\">&#160;<\/font><\/font><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 10pt;line-height: 13pt\"><font face=\"Consolas\"><span style=\"font-family:;color:;line-height: 11pt\"><font color=\"#0000ff\"><font style=\"font-size: 9.5pt\">End<\/font><\/font><\/span><font style=\"font-size: 9.5pt\"><span style=\"font-family:;color:;line-height: 11pt\"> <\/span><\/font><span style=\"font-family:;color:;line-height: 11pt\"><font style=\"font-size: 9.5pt\" color=\"#0000ff\">Class<\/font><\/span><\/font><\/p>\n<\/blockquote>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 10pt;line-height: 13pt\">After the Test is created you will want to make it available as a template.&#160; <\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 10pt;line-height: 13pt\">This way testers and Automation engineers won\u2019t have to manually add a bunch of references or paste in blocks of code\u2026luckily we make this pretty straight forward. <\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 10pt;line-height: 13pt\">&#160;<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 10pt;line-height: 13pt\">Note: Anna Russo has done a better sample using the generic test; please see: <\/p>\n<p><a href=\"http:\/\/visualstudiogallery.msdn.microsoft.com\/ef313348-8fd1-463b-9404-7472db99fda5\">http:\/\/visualstudiogallery.msdn.microsoft.com\/ef313348-8fd1-463b-9404-7472db99fda5<\/a><\/p>\n<p>&#160;<\/p>\n<p>&#160;<\/p>\n<p class=\"MsoNormal\" style=\"margin: 0in 0in 10pt;line-height: 13pt\"><a href=\"https:\/\/devblogs.microsoft.com\/00\/00\/00\/45\/92\/metablogapi\/2438.image_21518C1C.png\"><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/11\/1057.image_thumb_6BD8C9F6.png\" width=\"219\" height=\"244\" \/><\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/00\/00\/00\/45\/92\/metablogapi\/2133.image_1959E9BA.png\"><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/11\/0550.image_thumb_071122F8.png\" width=\"277\" height=\"235\" \/><\/a><\/p>\n<p>&#160;<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/00\/00\/00\/45\/92\/metablogapi\/8715.image_46DB097D.png\"><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/11\/6232.image_thumb_519860D2.png\" width=\"283\" height=\"168\" \/><\/a><\/p>\n<p>&#160;<\/p>\n<p><font color=\"#0000ff\" size=\"3\">Step4. Set the newly created Visual Studio Tests to be executed during the automation testing <\/font><\/p>\n<p>In step 2 you created a Test Case- but how do you get it to execute your Visual Studio created in step 3?&#160;&#160; <\/p>\n<p>Turns out there are a couple of ways to do this; using Visual Studio, import the test cases using TCM finally and probably the method our partners and ISV will want to use programmatically. <\/p>\n<p>Here are the directions for each: <\/p>\n<p>1.&#160; <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd380741.aspx\">How to: Associate an Automated Test with a Test Case<\/a>&#160;<\/p>\n<p>2. <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ff942471.aspx\">tcm: Importing Automated Tests into Test Cases<\/a><\/p>\n<p>3. <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2012\/01\/01\/how-to-associate-automation-programmatically.aspx\">How To: Associate automation programmatically<\/a><\/p>\n<p>&#160;<a href=\"https:\/\/devblogs.microsoft.com\/00\/00\/00\/45\/92\/metablogapi\/4572.image_0C1360A7.png\"><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/11\/5165.image_thumb_43E5A4CA.png\" width=\"347\" height=\"188\" \/><\/a><\/p>\n<p>&#160;<\/p>\n<p>For its worth, in Microsoft Test Manager \u2013 there is a tab called \u201cAssociated Automation\u201d but it is intended to show testers which tests were set to run during automation and therefore is read only. <\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/00\/00\/00\/45\/92\/metablogapi\/2548.image_11624758.png\"><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/11\/4505.image_thumb_3757F7AE.png\" width=\"347\" height=\"165\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been working with different partners in the testing space for the last couple of months and a frequently asked question is: \u201cWhere do we start integrating our test tools with the Microsoft application life cycle platform?\u201d And the answer is relatively straight simple \u201cYou need to integrate yourself into the development workflow\u2026we use [&hellip;]<\/p>\n","protected":false},"author":81,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3863","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"acf":[],"blog_post_summary":"<p>I have been working with different partners in the testing space for the last couple of months and a frequently asked question is: \u201cWhere do we start integrating our test tools with the Microsoft application life cycle platform?\u201d And the answer is relatively straight simple \u201cYou need to integrate yourself into the development workflow\u2026we use [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/3863","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=3863"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/3863\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=3863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=3863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=3863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}