Ela*_*Ela 1 selenium microsoft-test-manager selenium-webdriver azure-devops
如何使用API在VSTS / Microsoft测试管理器中更新测试结果。如何使用Selenium / Java更新VSTS / Microsoft Test Manager中的测试结果。
通过API更新测试结果的过程:
首先使用以下API获得测试用例的测试点:为此,您需要计划ID,套件ID和测试用例ID。在Web视图中打开套件,在URL中可以找到计划ID和套件ID,测试用例ID是测试用例的ID。
得到 https://{instance}/DefaultCollection/{project}/_apis/test/plans/{plan}/suites/{suite}/points?api-version={version}&testCaseId={string}
发送请求并记下测试点(作为响应)。
有关详细信息,请参阅:https : //docs.microsoft.com/zh-cn/vsts/integrate/previous-apis/test/points?view=vsts#get-a-test-point
开机自检 https://{instance}/DefaultCollection/{project}/_apis/test/runs?api-version={version}
样品体
{
"name": "Sprint 10 Test Run",
"plan": {
"id": 1234
},
"pointIds": [
10
]
}
Run Code Online (Sandbox Code Playgroud)
发送请求并记下运行ID(响应)。
有关详细信息,请参阅:https : //docs.microsoft.com/zh-cn/vsts/integrate/previous-apis/test/runs?view=vsts#create-new-test-run
开机自检 https://{instance}/DefaultCollection/{project}/_apis/test/runs/{run}/results?api-version={version}
样品体
[
{
"state": "Completed",
"testPoint": {
"id": 10
},
"outcome": "Passed",
"testCase": {
"id": 4567
}
}
]
Run Code Online (Sandbox Code Playgroud)
发送请求并记录结果ID(来自响应)。
有关详细信息,请参阅:https : //docs.microsoft.com/zh-cn/vsts/integrate/previous-apis/test/results?view=vsts#add-test-results-to-a-test-run
补丁
https://{instance}/DefaultCollection/{project}/_apis/test/runs/{run}?api-version={version}
Run Code Online (Sandbox Code Playgroud)
样品体
[
{
"id": 100000,
"state": "Completed"
}
]
Run Code Online (Sandbox Code Playgroud)
有关详细信息,请参阅:https : //docs.microsoft.com/zh-cn/vsts/integrate/previous-apis/test/runs?view=vsts#update-test-run
现在,检查VSTS /测试管理器以获取结果更新。另外,您还可以更新特定配置的结果,只需在添加测试结果的正文中添加配置即可。有关配置的详细信息,请参阅:https : //docs.microsoft.com/zh-cn/vsts/integrate/previous-apis/test/configurations?view=vsts#get-a-list-of-test- configurations
现在要使用Java更新结果,请使用RestAssured发送get,post,patch请求并从响应中检索特定数据。有关放心的详细信息,请参阅:https : //github.com/rest-assured/rest-assured/wiki/Usage
为了发送发布和补丁请求,您可能需要创建json对象/实体,为此使用minidev json库。如何创建JSON对象/数组:如何使用String创建JSON对象?
| 归档时间: |
|
| 查看次数: |
539 次 |
| 最近记录: |