lczub / TestLink-API-Python-client

A Python client to use the TestLink API
104 stars 63 forks source link

xml.parsers.expat.ExpatError coming while calling countProjects() for Testlink 1.9.9 #97

Closed shreyas-kj closed 5 years ago

shreyas-kj commented 6 years ago

This is my Testlink test code (target's version is 1.9.9) - import testlink tls = testlink.TestLinkHelper().connect(testlink.TestlinkAPIClient) tls.countProjects()

I've set Testlink server URL and devkey inside Testlinkhelper.py itself.

This is the error coming everytime I am running the script. Traceback (most recent call last): File "ttest.py", line 3, in tls.countProjects() File "/usr/local/lib/python2.7/dist-packages/testlink/testlinkapi.py", line 376, in countProjects projects=self.getProjects() File "/usr/local/lib/python2.7/dist-packages/testlink/testlinkdecorators.py", line 140, in wrapperReplaceTLResponseError response = methodAPI(self, *argsPositional, argsOptional) File "/usr/local/lib/python2.7/dist-packages/testlink/testlinkdecorators.py", line 112, in wrapperAddDevKey return methodAPI(self, *argsPositional, *argsOptional) File "/usr/local/lib/python2.7/dist-packages/testlink/testlinkdecorators.py", line 100, in wrapperWithArgs argsPositional, argsOptional) File "/usr/local/lib/python2.7/dist-packages/testlink/testlinkapigeneric.py", line 1514, in callServerWithPosArgs response = self._callServer(methodNameAPI, argsOptional) File "/usr/local/lib/python2.7/dist-packages/testlink/testlinkapigeneric.py", line 1770, in _callServer response = getattr(self.server.tl, methodNameAPI)(argsAPI) File "/usr/lib/python2.7/xmlrpclib.py", line 1243, in call return self.send(self.name, args) File "/usr/lib/python2.7/xmlrpclib.py", line 1602, in request verbose=self.verbose File "/usr/lib/python2.7/xmlrpclib.py", line 1283, in request return self.single_request(host, handler, request_body, verbose) File "/usr/lib/python2.7/xmlrpclib.py", line 1316, in single_request return self.parse_response(response) File "/usr/lib/python2.7/xmlrpclib.py", line 1487, in parse_response p.feed(data) File "/usr/lib/python2.7/xmlrpclib.py", line 558, in feed self._parser.Parse(data, 0) xml.parsers.expat.ExpatError: junk after document element: line 2, column 0

Help in this is highly appreciated.

lczub commented 6 years ago

Hello Shreyas-Kj,

well TL 1.9.9 is not the newest version , so it might be that you have to use an older api_client version, e.g. v0.4.8. But the traceback loócks like your TL server returns an invalid xml structure. That is a known behaviour, when the TL php client runs into an internal sever error. If you want to debug this, take a look into How to check original exchanged XML data. But this debugging feature requires an api_client v0.6.2 or higher.

Regards Luiko

lczub commented 5 years ago

Closed - no additional input