<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom"><channel><title>Inflectra Customer Forums: Spiratest 5.0  REST API record test-run,  Example how (Thread)</title><description>&#xD;
Hi,  I found a few methods in API documentation section: http://api.inflectra.com/Spira/Services/v5_0/RestService.aspx#Automated%20Test%20Run  In requests body, there are many fields I have no idea how to use. Could someone please explain with some short example how to record an automated test run? What preconditions needed in testcase/testset? What are the required and optional fields in request body?   I am using python script to communicate with REST API 5.0 and getting the error:  The server encountered an error processing the request.   I have the following data in POST request body:  postbody = {"ProjectId":  "3", "ExecutionStatusId": "1", "ReleaseId":  "159", "TestCaseId":"15542", "TestSetId":"654", "TesterId":"586", "RunnerName":"Python" }  The exception &#xD;
message is \'There was an error checking start element of object of type&#xD;
&#xD;
Inflectra.SpiraTest.Web.Services.v5_0.DataObjects.RemoteAutomatedTestRun.&#xD;
  Encountered unexpected character \'T\'.\'. See server logs for more &#xD;
details.     &#xD;
&#xD;
</description><language>en-US</language><copyright>(C) Copyright 2006-2026 Inflectra Corporation.</copyright><managingEditor>support@inflectra.com</managingEditor><category domain="http://www.dmoz.org">/Computers/Software/Project_Management/</category><category domain="http://www.dmoz.org">/Computers/Software/Quality_Assurance/</category><generator>KronoDesk</generator><a10:contributor><a10:email>support@inflectra.com</a10:email></a10:contributor><a10:id>http://www.inflectra.com/kronodesk/forums/threads</a10:id><ttl>120</ttl><link>/Support/Forum/spiratest/issues-questions/1527.aspx</link><item><guid isPermaLink="false">threadId=1527</guid><author>Andras N (g1685186@mvrht.com)</author><category domain="http://www.inflectra.com/kronodesk/thread/tag">rest</category><category domain="http://www.inflectra.com/kronodesk/thread/tag"> api</category><category domain="http://www.inflectra.com/kronodesk/thread/tag"> spiratest</category><category domain="http://www.inflectra.com/kronodesk/thread/tag"> 50</category><category domain="http://www.inflectra.com/kronodesk/thread/tag"> record test runs</category><category domain="http://www.inflectra.com/kronodesk/thread/tag"> rest api</category><title>Spiratest 5.0  REST API record test-run,  Example how</title><description>&#xD;
Hi,  I found a few methods in API documentation section: http://api.inflectra.com/Spira/Services/v5_0/RestService.aspx#Automated%20Test%20Run  In requests body, there are many fields I have no idea how to use. Could someone please explain with some short example how to record an automated test run? What preconditions needed in testcase/testset? What are the required and optional fields in request body?   I am using python script to communicate with REST API 5.0 and getting the error:  The server encountered an error processing the request.   I have the following data in POST request body:  postbody = {"ProjectId":  "3", "ExecutionStatusId": "1", "ReleaseId":  "159", "TestCaseId":"15542", "TestSetId":"654", "TesterId":"586", "RunnerName":"Python" }  The exception &#xD;
message is \'There was an error checking start element of object of type&#xD;
&#xD;
Inflectra.SpiraTest.Web.Services.v5_0.DataObjects.RemoteAutomatedTestRun.&#xD;
  Encountered unexpected character \'T\'.\'. See server logs for more &#xD;
details.     &#xD;
&#xD;
</description><pubDate>Tue, 30 Aug 2016 11:42:18 -0400</pubDate><a10:updated>2022-04-04T16:00:21-04:00</a10:updated><link>/Support/Forum/spiratest/issues-questions/1527.aspx</link></item><item><guid isPermaLink="false">messageId=2740</guid><author>David J (adam.sandman+support@inflectra.com)</author><title>&#xD;
Hi Andras  I think the issue is that you need to stringify the JSON before sending:   http://stack</title><description>&#xD;
Hi Andras  I think the issue is that you need to stringify the JSON before sending:   http://stackoverflow.com/questions/2484377/wcf-encountered-unexpected-character-c    Regards  Adam &#xD;
&#xD;
</description><pubDate>Tue, 06 Sep 2016 16:54:26 -0400</pubDate><a10:updated>2016-09-06T16:54:26-04:00</a10:updated><link>/Support/Forum/spiratest/issues-questions/1527.aspx#reply2740</link></item><item><guid isPermaLink="false">messageId=2745</guid><author>Andras N (g1685186@mvrht.com)</author><title>&#xD;
Hi, Thanks Adam for your response.  I think I found out the correct way of calling this method.   </title><description>&#xD;
Hi, Thanks Adam for your response.  I think I found out the correct way of calling this method.   Here is my working python code:       def recordTestRun(self , **kwargs ):         if kwargs.has_key("projectID"):             self.projectID = kwargs["projectID"]          postbody = json.dumps( { "ProjectId":2, "ExecutionStatusId":2, "ReleaseId":157, "TestCaseId":33474, "TestSetId":942, "TesterId":145, "RunnerName":"Python" , "StartDate": "/Date(" + str(int(time.time())) + ")/" , "ConcurrencyDate": "/Date(" + str(int(time.time())) + ")/" } )         url = self.baseURL +  '/projects/2/test-runs/record'         result = requests.post( url, headers=self.headers, data = postbody )          return result  BRs, Andras &#xD;
&#xD;
</description><pubDate>Tue, 13 Sep 2016 08:14:39 -0400</pubDate><a10:updated>2016-09-13T08:14:39-04:00</a10:updated><link>/Support/Forum/spiratest/issues-questions/1527.aspx#reply2745</link></item></channel></rss>