not possible to add note by using "reportTCResult"

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
partymungo
Advanced user
Posts: 20
Joined: Thu Aug 21, 2008 12:45 pm

not possible to add note by using "reportTCResult"

Post by partymungo »

Hi,
i try to add a testresult and corresponding note to a testcase by using "reportTCResult" and get the following error:

result = client.reportTCResult(testcase_id, testplan_id, result, build_id, note)
TypeError: reportTCResult() takes exactly 4 arguments (6 given)

("result" and "note" are strings, the others are int)
Adding a testresult without "build_id" and "note" works fine.

Some ideas?
Thanks in advance.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Post by fman »

this is not bugtracking => add issue with TL version used and steps to reproduce on mantsi
partymungo
Advanced user
Posts: 20
Joined: Thu Aug 21, 2008 12:45 pm

Post by partymungo »

done
partymungo
Advanced user
Posts: 20
Joined: Thu Aug 21, 2008 12:45 pm

Post by partymungo »

Hi,
this problem is not a TL bug, it was a problem within my implementation. For those who are interested, this code will work:

Code: Select all

class TestlinkAPIClient:
	SERVER_URL = "http://localhost/testlink/lib/api/xmlrpc.php"
	DEV_KEY = "YOURDEVKEY"
	def __init__(self):
		self.server = xmlrpclib.Server(self.SERVER_URL)
		
	def reportTCResult(self, tcid, tpid, status, notes):
		data = {"devKey":self.DEV_KEY, "testcaseid":tcid, "testplanid":tpid, "status":status, "notes":notes, "guess":"true"}
		return self.server.tl.reportTCResult(data)

...

client 			= TestlinkAPIClient()
client.reportTCResult(tcid, tpid, result, note)
cu
naveentiru
TestLink user
Posts: 10
Joined: Mon May 18, 2009 11:53 am

Post by naveentiru »

Hi,

Please give me the details of how to work with XMlRPC in TL.

Regards,
Naveen
ccc123
TestLink user
Posts: 10
Joined: Wed Oct 14, 2009 11:18 pm

Post by ccc123 »

your code does not use buildid to report the result.

when i tried to use buildid to report the result, it gave error. it's in C#.
but when i call the sample code, the result was added with buildid, planid, tcid, notes..

not sure if it's a problem with Testlink API or in my code.
without buildid, the ressul was always inserted to the latest build, per described in api document.

partymungo wrote:Hi,
this problem is not a TL bug, it was a problem within my implementation. For those who are interested, this code will work:

Code: Select all

class TestlinkAPIClient:
	SERVER_URL = "http://localhost/testlink/lib/api/xmlrpc.php"
	DEV_KEY = "YOURDEVKEY"
	def __init__(self):
		self.server = xmlrpclib.Server(self.SERVER_URL)
		
	def reportTCResult(self, tcid, tpid, status, notes):
		data = {"devKey":self.DEV_KEY, "testcaseid":tcid, "testplanid":tpid, "status":status, "notes":notes, "guess":"true"}
		return self.server.tl.reportTCResult(data)

...

client 			= TestlinkAPIClient()
client.reportTCResult(tcid, tpid, result, note)
cu
Post Reply