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.
not possible to add note by using "reportTCResult"
Moderators: Amaradana, TurboPT, TL Developers
-
- Advanced user
- Posts: 20
- Joined: Thu Aug 21, 2008 12:45 pm
-
- Advanced user
- Posts: 20
- Joined: Thu Aug 21, 2008 12:45 pm
Hi,
this problem is not a TL bug, it was a problem within my implementation. For those who are interested, this code will work:
cu
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)
-
- TestLink user
- Posts: 10
- Joined: Mon May 18, 2009 11:53 am
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.
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:
cuCode: 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)