Reporting results with addTestRecordToTestRun

Posts: 1
Joined: Tue Mar 07, 2017 10:25 am

Reporting results with addTestRecordToTestRun

Postby jolsn » Tue Mar 07, 2017 11:46 am

I am trying to report test case results via the webservice API with python.

I am able to create a test run from a template using the createTestRunWithTitle method. The template has been set to select test cases "By query on create". Among other test cases, this query will add the test case TSTP-643 to the test run. I do like this in python to report results to the test run:

Code: Select all

tstRunURI = test_management_service.service.createTestRunWithTitle("testProject", "testTestrunId", "testTestRunTitle", "testRunTemplate")
wi = tracker_service.service.getWorkItemById('testProject', 'TSTP-643')
tstRecord = test_management_service.factory.create(u'ns2:TestRecord') = "passed"
tstRecord.testCaseURI = wi._uri
test_management_service.service.addTestRecordToTestRun(tstRunURI, tstRecord)

The final call gives me the exception

Code: Select all

  File "", line 93, in reportresults
    test_management_service.service.addTestRecordToTestRun(tstRunURI, tstRecord)
  File "/usr/lib/python2.7/dist-packages/suds/", line 566, in __call__
    return client.invoke(args, kwargs)
  File "/usr/lib/python2.7/dist-packages/suds/", line 705, in invoke
    result = self.send(soapenv)
  File "/usr/lib/python2.7/dist-packages/suds/", line 752, in send
    return self.process_reply(content, e.httpcode, tostr(e))
  File "/usr/lib/python2.7/dist-packages/suds/", line 814, in process_reply
    raise WebFault(fault, replyroot)
suds.WebFault: Server raised fault: 'java.lang.NullPointerException'

Does anyone have an idea on what I am doing wrong here?

Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 13 guests