Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Post failed error 400 via xcuitest xcode


#1

Hallo, i have problem when post from xcuitest into testrail. I get error 400 and it’s say “error = “Invalid or incomplete JSON string in API request.”;” but it run smoothly when i post manually using postman. Here example what i post:

post: https://mydomain.testrail.com/index.php?/api/v2/add_results_for_cases/tes_runID
body (via postman):
{
“results”: [
{
“case_id”: 3656,
“status_id”: 11,
“comment”: “fail example”,
“elapsed” : “50s”
}
]
}

(via xcuitest):
@{
@“results”: @[
@{
@“case_id” : @3656,
@“status_id”: @11,
@“comment” : @“fail example”,
@“elapsed” : @“50s”
}
]}

NOTE: it’s no error for GET.


#2

Ah sorry I already know the answer. :bowing_man: