Test Center supports partial success responses for batch operations such as creating or managing multiple resources simultaneously.
The HTTP response code for batch operations is 207
. The response is an object that consists of two arrays, successes
and failures
. The successes
array contains details of items for which the operation was successful. The failures
array contains a list of HTTP Problem Details objects organized by a type of problem. It indicates errors together with unique identifiers of items for which the operation failed. The included objects are the same type of object as those for individual failure responses, described in Errors.
This sample error response shows mixed results when trying to create test cases.
{
"successes": [
{
"createdBy": "jsmith",
"createdDate": "2022-03-17T07:08:47+0000",
"modifiedBy": "jsmith",
"modifiedDate": "2022-03-17T07:08:47+0000",
"testCaseId": 1,
"testRequest": {
"testRequestUrl": "http://lab1.gsshappylearning.com/akamaiflowershop/product/category/1231212/1",
"requestHeaders": [
{
"headerName": "Accept-ATC_QA_Automation-1628040866485",
"headerValue": "Application/html",
"headerAction": "add"
}
]
},
"clientProfile": {
"ipVersion": "ipv6"
},
"condition": {
"conditionExpression": "Response header \"SOME ST\" does not exist"
},
"order": 1
}
],
"failures": [
{
"type": "invalid.condition.expression",
"title": "Condition expression is not valid",
"requestField": "condition",
"requestValues": [
{
"conditionExpression": "Ignore case in cache 123 key - case is ignored in cache key"
}
]
},
{
"type": "data.type.mismatch",
"title": "Data type mismatch",
"requestField": "condition",
"requestValues": [
{
"conditionExpression": "Response code is one of \"a200\""
}
]
},
{
"type": "duplicate.resource.in.payload",
"title": "Duplicate resource found in payload",
"requestField": "testRequest.requestHeaders[].headerName",
"requestValues": [
"Accept-ATC_QA_Automation-1628040866485"
]
},
{
"type": "hostname.access.missing",
"title": "Hostname access missing",
"requestField": "testRequest.testRequestUrl",
"requestValues": [
"http://lab12.gsshappylearning.com/akamaiflowershop/product/category/1231212/1"
]
},
{
"type": "url.path.should.contain.alphabetic.characters",
"title": "Test request URL path should contain one or more alpha characters",
"requestObjects": [
{
"testRequest": {
"testRequestUrl": "http://lab1.gsshappylearning.com/123"
},
"clientProfile": {
"ipVersion": "ipv6"
},
"condition": {
"conditionExpression": "Ignore case in cache key - case is ignored in cache key"
},
"order": 5
}
]
},
{
"type": "url.should.contain.query.param",
"title": "Test request URL should contain query parameters",
"requestObjects": [
{
"testRequest": {
"testRequestUrl": "http://lab1.gsshappylearning.com/"
},
"clientProfile": {
"ipVersion": "ipv6"
},
"condition": {
"conditionExpression": "Cache key query parameters - query parameters included and are \"queryParameterNames\""
},
"order": 3
}
]
},
{
"type": "url.should.contain.path",
"title": "Test request URL should contain path parameters",
"requestObjects": [
{
"testRequest": {
"testRequestUrl": "http://lab1.gsshappylearning.com/"
},
"clientProfile": {
"ipVersion": "ipv6"
},
"condition": {
"conditionExpression": "Ignore case in cache key - case is ignored in cache key"
},
"order": 4
}
]
},
{
"type": "resource.not.found",
"title": "Resource not found",
"requestField": "variableName",
"requestValues": [
"var2",
"var1"
]
}
]
}