Forum Discussion

Param_Chopra's avatar
Param_Chopra
SmartBear Alumni (Retired)
7 years ago

Continuous Integration and QAComplete

Hello QAComplete Community!

 

On Wednesday the 20th, we hosted our QAComplete 301 Webinar, courtesy of SmartBear Academy, your source for training webinars ranging from introductions to our tools to advanced topics within the software testing space. 

 

This past 301 was about Continuous Integration, specifically regarding how we can trigger TestComplete tests to run from a Jenkins Build, while having the test run results from TestComplete uploaded into the corresponding QAComplete test cases automatically.

 

The above is a specific implementation of CI of course, but it can serve as a template for those of you hoping to take advantage of QAComplete's REST API.  Thus, one could use any build tool, as well as any automation tool (although we hope it's either SoapUI or TestComplete!) in concert with QAComplete to set up one's CI framework.

 

The link to Wednesday 301 is below, so you can see how I set up my instance of this type of workflow.  After that, I will detail out the abstracted steps I took to get my test run data into QAComplete, without ever having to touch the tool's interface.

 

https://attendee.gotowebinar.com/recording/8676565498666968077

 

The general algorithm I followed to get my test results into QAComplete via our REST API: 

 

 

  1. POST to create a new test run in QAComplete
  2. Query the “id” field from the response returned from the above POST method.  This “id” is your RunId.
  3. GET to retrieve the ItemId from your test case in your test run
  4. Query the “id” field within the “results” field in the response returned by the above GET method.  This “id” is your ItemId.
  5. PATCH to update a test case's run results in a test run
  6. POST to upload the test log for your test run

 

After these 6 steps, whether you want to script them out, use cURL, or use the command line, you should be able to have your test results populate into QAComplete in an automated fashion.  Please let us know if you have any questions, comments, or feedback about this integration, and see you on the upcoming 101, 201, and 301!

 

Best,

 

Param Chopra

Sales Engineer

450 Artisan Way, 4th Floor

Somerville, MA 02145 United States

 

3 Replies

  • 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 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

    Any suggestion?
     
    Thanks in advance,
    Jeff

     

  • ahadley's avatar
    ahadley
    Occasional Contributor

    Is the webinar referenced above still available?  The link is broken.

  • Marramreddy's avatar
    Marramreddy
    Occasional Contributor

    Param_Chopra  Its been more than a year you have posted this solution. Does smart bear has a better or standed solution for Continuous Integration through QAComplete.

     

    FYI rkkreddy