如何将UFT 12.25与VSTS集成

如何将UFT 12.25与VSTS集成

问题描述:

我们正在使用UFT自动化基于Windows的应用程序,并且客户要求我们将UFT与VSTS进行集成,因为功能测试团队正在所有测试生命周期中使用VSTS仪表板。 如果任何人已经提前实施了这个东西,或者目前正在使用这个东西,请帮助我。 问候 拉曼·库马尔如何将UFT 12.25与VSTS集成

+0

检查这些链接http://*.com/questions/37339104/uft-12-02-qtp-integration-with-tfs和https://visualstudio.uservoice。 com/forums/330519-team-services/suggestions/3251899-integration-between-qtp-team-foundation-server-t –

+0

谢谢@strain-MSFT用于共享链接..它看起来像链接与UFT和TFS相关积分。而我关心的是UFT-VSTS集成。我们需要在UFT中运行我们的脚本,然后将结果发回VSTS。 –

+0

你想在VSTS构建过程中做到这一点吗?如果是这样,您可以通过命令行(例如PowerShell)在UFT中运行测试,然后通过发布测试结果步骤(https://www.visualstudio.com/en-us/docs/build/steps/test)将测试结果发布到TFS /发布 - 测试结果)。如果要将测试结果与测试用例相关联,则可以通过TCM工具发布测试结果(https://msdn.microsoft.com/en-us/library/ff942469.aspx?f=255&MSPPError=-2147217396) –

请按以下步骤:

  1. 通过詹金斯运行UFT脚本建立
  2. 呼叫VSTS REST API来创建新的测试运行和更新测试结果与指定的错误。

Create new test run

Update test results for a test run

您可以通过使用Microsoft Team Foundation Server Extended Client调用REST API。

简单代码:

var u = new Uri("https://[account].visualstudio.com"); 
VssCredentials c = new VssCredentials(new Microsoft.VisualStudio.Services.Common.VssBasicCredential(string.Empty, "[personal access token]")); 
var connection = new VssConnection(u, c); 
var testClient = connection.GetClient<TestManagementHttpClient>(); 
      int testpointid = 158; 
      string teamProject = "scrum2015"; 

      RunCreateModel run = new RunCreateModel(name:"APIRun7",plan:new Microsoft.TeamFoundation.TestManagement.WebApi.ShallowReference("232"),pointIds:new int[] { testpointid }); 

      TestRun testrun = testClient.CreateTestRunAsync(teamProject, run).Result; 

      TestCaseResultUpdateModel testCaseUpdate = new TestCaseResultUpdateModel() { State="Completed", Outcome="Passed", TestResult=new Microsoft.TeamFoundation.TestManagement.WebApi.ShallowReference("100000") }; 

      var testResults = testClient.UpdateTestResultsAsync(new TestCaseResultUpdateModel[] { testCaseUpdate }, teamProject, testrun.Id).Result; 

      RunUpdateModel runmodel = new RunUpdateModel(state: "Completed"); 

      TestRun testRunResult= testClient.UpdateTestRunAsync(teamProject, testrun.Id, runmodel).Result; 
+0

我仍然无法解决测试运行的上传测试结果,我已经通过上述链接“更新测试运行的测试结果”,我无法理解。我是否需要创建任何API或可以使用内置的API,你可以请分享任何一步一步的文档。 –

+0

这是通过HTTP请求调用的REST API。您可以调用该REST API编程,例如我通过我提供的代码说。 –