Page 1 of 1

About testlink automation

PostPosted: Wed Apr 22, 2009 6:16 am
by holmes86
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 = "http://172.16.70.48/testlink/lib/api/xmlrpc.php"



    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)

PostPosted: Wed Apr 22, 2009 8:45 am
by fman
please test using our PHP examples, and then move to other language

PostPosted: Mon May 04, 2009 8:12 pm
by tfeathers
where are the php samples? I can't find them...

Re: About testlink automation

PostPosted: Mon May 11, 2009 1:12 pm
by aprepo
You need to create the dev key to the database manually: table: users, column script_key...

PostPosted: Tue May 12, 2009 5:43 am
by prashant.katti
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.

regards
prashant

PostPosted: Tue May 12, 2009 9:32 am
by fman
you do not need to restart sql server.