Page 1 of 1

How to get the tprojectid and tplanid

PostPosted: Tue Apr 28, 2009 2:32 am
by ariman
Hi, I'm beginning to use TestLink API on Version 1.8.1, just find that many methods need the tprojectid and tplanid, but I'm really confused that how can I get them, could anybody give me a help, thanks! :cry:

PostPosted: Tue Apr 28, 2009 3:29 am
by ariman
I have found the tprojectid on GUI "Test Project Management", there it listed a project id is: [ID: 1].
But when I use method getProjectTestPlans with this id 1, it just returns me that : [{'message': 'No testcasename provided. A testcase name must be provided!', 'code': 170}] .

The following is my partially Python codes. Methods getInfo() and getProjects() are working well, but getProjectTestPlans() is not.

class TestlinkAPIClient:

SERVER_URL = "http://xx.xx.xx.xx/testlink181/lib/api/xmlrpc.php"

def __init__(self, devKey):
self.server = xmlrpclib.Server(self.SERVER_URL)
self.devKey = devKey

def getInfo(self):

def getProjects(self):
data = {'devKey':self.devKey}

def getProjectTestPlans(self, tpid):
data = {'devKey':self.devKey, 'tpid':int(tpid)}
print 'data : ',data

client = TestlinkAPIClient("eb1a9b4fca215788200bf9587cc69202")
print 'TestLink Info : ', client.getInfo(), '\n'

projects = client.getProjects()
print 'projects : ', projects, '\n'

projectPlans = client.getProjectTestPlans(1)
print 'projectPlans : ', projectPlans, '\n'

Please give me a help, thanks!

PostPosted: Wed Apr 29, 2009 5:15 pm
by fman
I only use php clients, try with this to get more understanding the sitch to python

PostPosted: Thu Apr 30, 2009 1:52 am
by ariman
I tried PHP also, but still had the same problems. I'd submitted this issue into Mantis.

Good luck!