Page 1 of 1

403 forbidden error - xmlrpc

PostPosted: Tue Oct 20, 2009 10:05 pm
by josri
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")
......
......

Issue fixed: 403 forbidden error - xmlrpc

PostPosted: Thu Oct 22, 2009 4:50 pm
by josri
It was just a double quotes missing for the url :(
Wish it just said that.