2017-05-11 31 views
0

我們正在使用UFT自動化基於Windows的應用程序,並且客戶要求我們將UFT與VSTS進行集成,因爲功能測試團隊正在所有測試生命週期中使用VSTS儀表板。 如果任何人已經提前實施了這個東西,或者目前正在使用這個東西,請幫助我。 問候 拉曼·庫馬爾如何將UFT 12.25與VSTS集成

+0

檢查這些鏈接http://stackoverflow.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) –

回答

0

請按以下步驟:

  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編程,例如我通過我提供的代碼說。 –