TL API issue

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

TL API issue

Postby xavier » Wed May 07, 2008 2:34 pm

Hi testlink team,

First of all, thank you for your good work.
I installed the latest testlink release from CVS, and try to use the TL API.

I write a python script (based on your sample script) which used all available TL API (reportTCResult, getProjects, getProjectTestPlans, getTestCasesForTestSuite, createBuild, getTestCaseIDByName ...)

I used getTestCaseIDByName to retreive the testcaseID then, I used reportTCResult to send the test result.

it seems that getTestCaseIDByName doesn't return the correct id. This function return : id and parentid. When I call reportTCResult, I've got this error:

[{'message': 'No tcid provided. A valid tcid must be provided!', 'code': 110}, {'message': 'LOCALIZE: API_NO_TCASEEXTERNALID', 'code': 110}]

- after calling : getTestCaseIDByName:
[{'parent_id': '380', 'id': '381', 'name': 'logs_string'}]
- before calling
the data is :
{'status': 'p', 'tcid': '381', 'devKey': 'f2a979d533cdd9761434bba60a88e4d8', 'tpid': '415'}
- reportTCResult return :
[{'message': 'No tcid provided. A valid tcid must be provided!', 'code': 110}, {'message': 'LOCALIZE: API_NO_TCASEEXTERNALID', 'code': 110}]

I see in the SQL table "tcversions" the ID "tc_external_id ". Is this ID we must send to reportTCResult ?

Sample of code (which used :
TLclient = CTestlinkAPIClient(testlinkurl, "f2a979d533cdd9761434bba60a88e4d8")
# Retreive the ID of the Project
TLprojecID = TLclient.getProjectIDbyName("MyTestProject")
TLTestPlanID = TLclient.getProjectTestPlanIDByName(TLprojecID, "automatedUnitTests")
TLTestCaseID = TLclient.getTestCaseIDByName("testname1", "suitename1")
result = TLclient.reportTCResult(TLTestCaseID, TLTestPlanID, "p")
print result

In attachment you'll find: : python script with the class 'CTestlinkAPIClient'

Thanks for the help.
TestLink user
Posts: 3
Joined: Tue Dec 04, 2007 1:36 pm

Postby havlatm » Mon May 12, 2008 10:55 am

I see that you already add the issue in tracker. Thanks.
Member of TestLink Community
Posts: 940
Joined: Mon Oct 31, 2005 1:24 am
Location: Czech

Return to XML-RPC API

Who is online

Users browsing this forum: No registered users and 0 guests