Forum Discussion
Hi Param,
I'm having issue with my code on uploading test log to QAComplete. Here is my code.
var url4 = 'https://qacomplete.smartbear.com/rest-api/service/api/v2/projects/(projID)/testruns/' + runID +'/items/' + itemId +'/report';
var files = '{"file":'+ aqFile.OpenBinaryFile("C:\\TCTests\\log.mht", aqFile.faRead)+'}';
var aqHttpRequest4 = aqHttp.CreatePostRequest(url4,username,password);
aqHttpRequest4.SetHeader("Content-Type", "application/json");
var aqHttpResponse4 = aqHttpRequest4.Send(files);
if(aqHttpResponse4.StatusCode == "200"){
Log.Message(aqHttpResponse4.Text);
} else {
Log.Error("Oh NO!");
}
When I run this code I'm getting this error
https://qacomplete.smartbear.com/rest-api/service/api/v2/projects/(projID)/testruns/1176611/items/8838812/report' was sent with the status code 500
Response status text: InternalServerError Response body: {"errors":[{"message":"Index was outside the bounds of the array.","code":0}]} All response headers: Cache-Control: private Date: Fri, 13 Jul 2018 05:21:54 GMT Content-Length: 78 Content-Type: application/json; Charset=UTF-8 Server: Microsoft-IIS/8.5 X-Powered-By: ServiceStack/3.960 Win32NT/.NET X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET X-ServerName: app21 X-Powered-By: ARR/3.0 X-Powered-By: ASP.NET X-ServerName: gw1
Response body:
{"errors":[{"message":"Index was outside the bounds of the array.","code":0}]}
All response headers:
Cache-Control: private
Date: Fri, 13 Jul 2018 05:21:54 GMT
Content-Length: 78
Content-Type: application/json; Charset=UTF-8
Server: Microsoft-IIS/8.5
X-Powered-By: ServiceStack/3.960 Win32NT/.NET
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-ServerName: app21
X-Powered-By: ARR/3.0
X-Powered-By: ASP.NET
X-ServerName: gw1
Any suggestion?
Jeff
Related Content
- 12 years ago
- 4 months ago
Recent Discussions
- 17 days ago