0

In our test we have requirement where data is created using Coded UI test and has to be passed into MTM and utalize from there in different scripts. In other words, rather than taking data from MTM into coded ui test, i need to send data into MTM parameter using coded ui test.

is it feasible? please let me know if someone has done so???

  • Can you give an example of what kind of value you're trying to pass into MTM and what you plan to do with it there? There are ways to use the TFS API to do what you're trying to do, but we'd need more info to make an informed suggestion. – Ryan Cox Jan 15 '15 at 13:56

2 Answers2

1

You would need to use the TFS Api. This is a good place to start.

http://www.codeproject.com/Articles/98216/TFS-API-Part-Test-Plans-Test-Suites-Test-Cases

What you want to do is feasible but you will need to really dig through the object model to get to where you need to be.

JL.
  • 78,954
  • 126
  • 311
  • 459
0

Using TFS API you connect to your test case and add a new column to it's datatable or you modify a currently existing column. But beware, all test cases use the same parameter set, if you add them via "add existing". Only if you do choose "copy and add to suite", then you have a new test case with its own parameters table.

You can use the TFS API either with C# and create an .exe file or you can also use PowerShell or even C# in PowerShell:

using (TfsTeamProjectCollection tp = new TfsTeamProjectCollection(collectionUrl))
{
    var tm = tp.GetService<ITestManagementService>();
    var tp = tm.GetTeamProject(teamProject);
    var tc = tp.TestCases.Find(testCaseId);

    tc.Data.Tables[0].Columns.Add("MyParam", typeof(String));
    tc.Data.Tables[0].Rows[0]["MyParam"] = "WinnerWinnerChickenDinner";

    tc.Save();
}
MushyPeas
  • 2,469
  • 2
  • 31
  • 48