403 forbidden error - xmlrpc

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

403 forbidden error - xmlrpc

Postby josri » Tue Oct 20, 2009 10:05 pm

Hi,

I tried the example python script to update testlink and that worked fine. Now, I am trying to include this in my selenium script and I get 403 forbidden error. I am using the exact same devkey, tcid and tpid, I used on the example script. Not sure, what I am doing wrong.

Thank you

TestlinkAPIClient.py:

#! /usr/bin/python
"""
Testlink API Python Client implementation
"""
import xmlrpclib

class TestlinkAPIClient:

def __init__(self, devKey, serverurl):
self.server = xmlrpclib.Server(serverurl)
self.devKey = devKey
print "In library:" + self.devKey

def getdevKey(self):
return self.devKey

def reportTCResult(self, tcid, tpid, status):
print tcid
print tpid
print self.devKey
print status
data = {"devKey":self.devKey, "testcaseid":tcid, "testplanid":tpid, "status":status, "guess":"true"}

return self.server.tl.reportTCResult(data)

def getInfo(self):
return self.server.tl.about()

My selenium script which calls the above:

import TestlinkAPIClient
....
....
testlinkurl = http://testlinkserver:8080/testlink/lib/api/xmlrpc.php
client = TestlinkAPIClient.TestlinkAPIClient("2abcd56ab7f9183a367bd93cc12341234", testlinkurl)

class login(unitest.TestCase):
def test_login(self):
try:
self.sel=Base.setUp()
self.sel.openurl(homeurl)
....
.....
result = client.reportTCResult(TCID, TPID, "p")
except Exception, e:
result = client.reportTcResult(TCID, TPID, "f")
......
......
josri
Advanced user
 
Posts: 30
Joined: Fri Jun 12, 2009 9:39 pm

Issue fixed: 403 forbidden error - xmlrpc

Postby josri » Thu Oct 22, 2009 4:50 pm

It was just a double quotes missing for the url :(
Wish it just said that.
josri
Advanced user
 
Posts: 30
Joined: Fri Jun 12, 2009 9:39 pm


Return to XML-RPC API



Who is online

Users browsing this forum: No registered users and 2 guests

cron