How are people getting platform IDs via the API?

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
gjc999
TestLink user
Posts: 6
Joined: Thu Mar 05, 2009 7:34 pm

How are people getting platform IDs via the API?

Post by gjc999 »

I'm looking in xmlrpc.class.php, and I'm not seeing a nice way to get platform IDs out of a project/testplan. Maybe I'm missing something obvious, but if anyone has a clever way of getting the platform IDs, I'd love to see it. I can inspect everything else I need to report test case results except the platform.

Thanks for any advice!
gjc999
TestLink user
Posts: 6
Joined: Thu Mar 05, 2009 7:34 pm

Re: How are people getting platform IDs via the API?

Post by gjc999 »

Well, I looked again after walking away for a bit and I think this does the job:

There is a function called getTestPlanPlatforms that takes a test plan ID ("testplanid") as part of the args list.

Example (Python):

import xmlrpclib

class TestlinkAPIClient:

SERVER_URL = "http://X.X.X.X/testlink/lib/api/xmlrpc.php"

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

def getTestPlanPlatforms(self, tp_id):
data = {"devKey":self.devKey, "testplanid":tp_id}
return self.server.tl.getTestPlanPlatforms(data)

I hope that helps someone (or at least those as challenged at searching as I apparently am. :)
Post Reply