Page 1 of 1

not possible to add note by using "reportTCResult"

Posted: Thu Nov 06, 2008 4:45 pm
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.

Posted: Sat Nov 08, 2008 8:39 am
by fman
this is not bugtracking => add issue with TL version used and steps to reproduce on mantsi

Posted: Mon Nov 10, 2008 10:36 am
by partymungo
done

Posted: Thu Nov 13, 2008 1:09 pm
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

Posted: Sat Jul 11, 2009 6:49 am
by naveentiru
Hi,

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

Regards,
Naveen

Posted: Sat Oct 17, 2009 2:30 am
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