将测试结果发布到TFS时出错

问题描述:

首先让我说我试图将自动化运行结果从Java代码发布到TFS中。

First of all let me say I am trying to post automation run results from Java code into TFS.

这是否可能?是

Is that even possible?

我已按照TFS Rest API上的说明首先创建一个新的测试运行:

(https://www.visualstudio.com/en- us / docs / integrate / api / test / runs#create-new-test-run)



然后我试图将结果添加到运行中,并且我收到了错误消息: 

" 值不能为null。\\ n参数名称:结果"

I have followed the instructions on the TFS Rest API to first create a new Test Run:
(https://www.visualstudio.com/en-us/docs/integrate/api/test/runs#create-new-test-run)

Then I'm trying to add a result to a run, and am getting the error: 
"Value cannot be null.\r\nParameter name: results"

此错误消息无效,因为没有名为"results"的字段。这个电话是存在的。

This error message is unhelpful, since no field named "results" exists for this call.

https://www.visualstudio.com/en-us/docs/integrate/api/test/results_1_0#add-test-results-to-a-测试运行

https://www.visualstudio.com/en-us/docs/integrate/api/test/results_1_0#add-test-results-to-a-test-run

以下是我的JSON代码:

Here is my JSON code below:

{

&quot ; testCaseTitle":" Post TFS Test Result",
" testCase&quot ;: {

" id":" 410421"

},
$
" priority":1,

" configuration&quot ;: {

" id":" 315"

},

" results":" Passed",
" startedDate":

}

{
"testCaseTitle": "Post TFS Test Result",
"testCase": {
"id": "410421"
},
"priority": 1,
"configuration": {
"id": "315"
},
"outcome": "Passed",
"startedDate":
}

JSON中是否必须有任何"自动"键才能生效?

Does there have to be any of the 'automated' keys in the JSON for this to work?

例如

"automatedTestName":{strin g。,"automatedTestStorage":{string}," automatedTestType&quot ;: {string}," automatedTestId":
{string}

James Afflec k,

此论坛讨论并提出要求有关扩展和集成Visual Studio的问题,由于您的问题与TFS更相关,我们会将其移至TFS论坛以获得适当的支持。

This forum discusses and asks questions about extending and integrating with Visual Studio, Since your issue is more related to TFS, we'll move it to TFS forum for suitable support.

感谢您的理解。

祝你好运,

Cole Wu