How to get the tprojectid and tplanid

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

How to get the tprojectid and tplanid

Postby ariman » Tue Apr 28, 2009 2:32 am

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:
ariman
TestLink user
 
Posts: 6
Joined: Tue Apr 28, 2009 2:27 am

Postby ariman » Tue Apr 28, 2009 3:29 am

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):
return self.server.tl.about()

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

def getProjectTestPlans(self, tpid):
data = {'devKey':self.devKey, 'tpid':int(tpid)}
print 'data : ',data
return self.server.tl.getProjectTestPlans(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!
ariman
TestLink user
 
Posts: 6
Joined: Tue Apr 28, 2009 2:27 am

Postby fman » Wed Apr 29, 2009 5:15 pm

I only use php clients, try with this to get more understanding the sitch to python
fman
Member of TestLink Community
 
Posts: 3073
Joined: Tue Nov 15, 2005 7:19 am

Postby ariman » Thu Apr 30, 2009 1:52 am

I tried PHP also, but still had the same problems. I'd submitted this issue into Mantis.

Good luck!
ariman
TestLink user
 
Posts: 6
Joined: Tue Apr 28, 2009 2:27 am


Return to XML-RPC API



Who is online

Users browsing this forum: No registered users and 1 guest