not possible to add note by using "reportTCResult"

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

not possible to add note by using "reportTCResult"

Postby partymungo » Thu Nov 06, 2008 4:45 pm

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.
partymungo
Advanced user
 
Posts: 20
Joined: Thu Aug 21, 2008 12:45 pm

Postby fman » Sat Nov 08, 2008 8:39 am

this is not bugtracking => add issue with TL version used and steps to reproduce on mantsi
fman
Member of TestLink Community
 
Posts: 3088
Joined: Tue Nov 15, 2005 7:19 am

Postby partymungo » Mon Nov 10, 2008 10:36 am

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

Postby partymungo » Thu Nov 13, 2008 1:09 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:

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
partymungo
Advanced user
 
Posts: 20
Joined: Thu Aug 21, 2008 12:45 pm

Postby naveentiru » Sat Jul 11, 2009 6:49 am

Hi,

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

Regards,
Naveen
naveentiru
TestLink user
 
Posts: 10
Joined: Mon May 18, 2009 11:53 am

Postby ccc123 » Sat Oct 17, 2009 2:30 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.


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
ccc123
TestLink user
 
Posts: 10
Joined: Wed Oct 14, 2009 11:18 pm


Return to XML-RPC API



Who is online

Users browsing this forum: No registered users and 6 guests