Inflectra Customer Forums: Spiratest 5.0 REST API record test-run, Example how (Thread) 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 message is \'There was an error checking start element of object of type Inflectra.SpiraTest.Web.Services.v5_0.DataObjects.RemoteAutomatedTestRun. Encountered unexpected character \'T\'.\'. See server logs for more details. en-US(C) Copyright 2006-2024 Inflectra Corporation.support@inflectra.com/Computers/Software/Project_Management//Computers/Software/Quality_Assurance/KronoDesksupport@inflectra.comhttp://www.inflectra.com/kronodesk/forums/threads120/Support/Forum/spiratest/issues-questions/1527.aspxthreadId=1527Andras N (g1685186@mvrht.com)REST API Spiratest 50 record test-runs REST APISpiratest 5.0 REST API record test-run, Example how 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 message is \'There was an error checking start element of object of type Inflectra.SpiraTest.Web.Services.v5_0.DataObjects.RemoteAutomatedTestRun. Encountered unexpected character \'T\'.\'. See server logs for more details. Tue, 30 Aug 2016 11:42:18 -04002022-04-04T16:00:21-04:00/Support/Forum/spiratest/issues-questions/1527.aspxmessageId=2740David J (support1@inflectra.com) Hi Andras I think the issue is that you need to stringify the JSON before sending: http://stack 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 Tue, 06 Sep 2016 16:54:26 -04002016-09-06T16:54:26-04:00/Support/Forum/spiratest/issues-questions/1527.aspx#reply2740messageId=2745Andras N (g1685186@mvrht.com) Hi, Thanks Adam for your response. I think I found out the correct way of calling this method. 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 Tue, 13 Sep 2016 08:14:39 -04002016-09-13T08:14:39-04:00/Support/Forum/spiratest/issues-questions/1527.aspx#reply2745