Rally JSON I/O error creating a test case result

最后都变了- 提交于 2019-12-18 06:57:32

问题


I am trying to create a test case result using a REST client, but get this error:

"Errors": ["Cannot parse input stream due to I/O error as JSON document: Parse error: expected '{' but saw '\uFFFF' [ chars read = >>>\uFFFF<<< ]"]

回答1:


I get the same error when the name of the object, testcaseresult is not specified in the request body. Here are the steps to create a test case result using a browser REST client:

a) Generate the authorize key using "GET" method and the following URL:

https://rally1.rallydev.com/slm/webservice/v2.0/security/authorize

This is the response that I get back, with the security token: "123abc..."

{"OperationResult": {"_rallyAPIMajor": "2", "_rallyAPIMinor": "0", "Errors": [], "Warnings": [], "SecurityToken": "abc123..."}}

b) Use "POST" method, and the following URL:

https://rally1.rallydev.com/slm/webservice/v2.0/testcaseresult/create?key=abc123...

notice the security token in the end.

c) here is an example of a request body:

{
"testcaseresult":
{
"Build":"1",
"Tester":"/user/777",
"Date":"2010-09-04T19:56:05.000Z",
"TestCase":"/testcase/1111",
"Verdict":"Pass"
}
}

Only the required fields and the fields you want to set need to be referenced. Notice the outer key/value pair

{
"testcaseresult":{}
}

The fields that point to a full object, like "Tester" (points to User object) and "TestCase" (points to a TestCase object that owns the result) have to be referenced by their ObjectIDs:

"Tester":"/user/777",
"TestCase":"/testcase/1111",


来源:https://stackoverflow.com/questions/18620056/rally-json-i-o-error-creating-a-test-case-result

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!