0
我們正在嘗試將UFT腳本與MTM集成。到目前爲止,我們成功地這樣做了。我們創建了許多使用TFS API的應用程序,我們對此感到滿意。如何使用c#更改MTM中測試用例的自動化狀態?
問題:我們怎樣才能改變一個測試用例的自動化狀態?
我們做了什麼:
TfsTeamProjectCollection tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("Your URL"));
ITestManagementTeamProject project = tfs.GetService<ITestManagementService>().GetTeamProject("Ypur Project Name");
ITestPlan testPlan = project.TestPlans.find("Your test plan ID");
ItestCaseCollection testcasecollection = testPlan.RootSuite.AllTestCases;
foreach (ITestCase testcase in testcasecollection)
{
if (testcase.Id=="YourTestcaseID")
{
//Now here we need tochange status of test case from Not Automated to automated
//we can change area path, title ,priority etc using TFS provided methods, but we cant change Automation status from Not Automated to others
testcase.status="Active"; // to change status of test case from closed to active.
// What is the method to change Automation status for a test case?? we only find method to get the automation status by using below method which is read only and returns value.
string str=testcase.IsAutomated(); // this returns but not sets
}
}
因此,在短期我們有使用C#像我們改變國家與其他國家改變測試用例自動化現狀MTM/TFS任何方法?
你保存'testcase'? – ds19
你正在使用哪個版本的tfs? –