About testlink automation

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

About testlink automation

Postby holmes86 » Wed Apr 22, 2009 6:16 am

hi,everyone.I want to using automation of testlink via XML/RPC.I modify python sample scripts and execute it.but report to " reportTCResult result was: [{'message': 'Can not authenticate client: invalid developer key', 'code': 2000}]". I don't set dev_key.what's dev_key value?thanks very much.

my scripts follow:

Code: Select all
#! /usr/bin/python


Testlink API Sample Python Client implementation


import xmlrpclib

class TestlinkAPIClient:

    # substitute your server URL Here

    SERVER_URL = ""

    def __init__(self, devKey):

        self.server = xmlrpclib.Server(self.SERVER_URL)

        self.devKey = devKey

    def reportTCResult(self, tcid, tpid, status):

        data = {"devKey":self.devKey, "tcid":tcid, "tpid":tpid, "status":status}

        return self.server.tl.reportTCResult(data)

    def getInfo(self):

        return self.server.tl.about()

# substitute your Dev Key Here

client = TestlinkAPIClient("f2a979d533cdd9761434bba60a88e4d8")

# get info about the server

print client.getInfo()

# Substitute for tcid and tpid that apply to your project

result = client.reportTCResult(1132, 56646, "p")

# Typically you'd want to validate the result here and probably do something more useful with it

print "reportTCResult result was: %s" %(result)
TestLink user
Posts: 1
Joined: Wed Apr 22, 2009 2:37 am

Postby fman » Wed Apr 22, 2009 8:45 am

please test using our PHP examples, and then move to other language
Member of TestLink Community
Posts: 3088
Joined: Tue Nov 15, 2005 7:19 am

Postby tfeathers » Mon May 04, 2009 8:12 pm

where are the php samples? I can't find them...
Advanced user
Posts: 19
Joined: Thu Mar 19, 2009 1:19 pm

Re: About testlink automation

Postby aprepo » Mon May 11, 2009 1:12 pm

You need to create the dev key to the database manually: table: users, column script_key...
TestLink user
Posts: 3
Joined: Mon May 11, 2009 1:07 pm

Postby prashant.katti » Tue May 12, 2009 5:43 am

Hi Homes,

You need to enable the feature by setting the API in the file config.inc.php,search for string:
/** XML-RPC API availability (disabled by default) */
$tlCfg->api->enabled = FALSE;

Change it to true.
$tlCfg->api->enabled = TRUE;

and restart the sql server.Now once you relogin to testlink if you click on profiles,you would get a devkey at the bottom.

Advanced user
Posts: 29
Joined: Mon Aug 18, 2008 11:06 am

Postby fman » Tue May 12, 2009 9:32 am

you do not need to restart sql server.
Member of TestLink Community
Posts: 3088
Joined: Tue Nov 15, 2005 7:19 am

Return to XML-RPC API

Who is online

Users browsing this forum: No registered users and 3 guests