lczub / TestLink-API-Python-client

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

Executing the program in the example directory has functions that cannot be used. #109

Closed reynold6215 closed 5 years ago

reynold6215 commented 5 years ago

Dear Sir,

The program I executed in the example directory has functions that cannot be used, and the functions cannot be executed as listed below. Error messages in execution such as attachments.

Do I have an execution order error or do I have to adjust it?

Execution environment: Ubuntu 16.04, Python 2.7.15, TestLink V1.9.17, TestLink API 0.8

Execution order TestLinkExample.py -->TestLinkExampleGernericApi.py --> TestLinkExampleGernericApi_Req.py --> TestLinkExample_CF_KW.py

Reynold error-information-log.txt

lczub commented 5 years ago

Hello Reynold,

this comment is related to the getAllExecutionsResults error messages:

reason for the getAllExecutionsResults errors is, that the TestLink V1.9.17 server itself has a known Bug TL Mantis Ticket 8259, documented inside TestLink python API 0.8 CHANGES.rst

I was unsure, if I should publish TestLink python API 0.8 supporting getAllExecutionsResults or not. But a fix is already publish inside the TestLink repository and you can easily implement it , by just extending inside lib/api/xmlrpc/v1/xmlrpc.class.php the function function initMethodYellowPages() with 'tl.getAllExecutionsResults' => 'this:getAllExecutionsResults',

Alternative is, not to call getAllExecutionsResults, when using the published TestLink V1.9.17 version

Regards Luiko

lczub commented 5 years ago

Samples TestLinkExample.py and TestLinkExampleGernericApi.py have no preconditions and should work independently . Please try with commenting out the getAllExecutionsResults calls.

Samples _TestLinkExample_CFKW.py and _TestLinkExampleGenericApiReq.py includes at the top instructions, which sample must run before and which additional files have to be loaded.

Hope, this info helps a little bit

Regards Luiko

reynold6215 commented 5 years ago

Dear Luiko,

Thank you for your explanation and assistance. After I made the relevant corrections according to your instructions, the situation is as follows:

1) TestLinkExample.py --> Have some error.(copy test case - as a new TC version is fail)

copy test case - as a new TC version

             #print("create new version of TC B")
             #response = myTestLink.copyTCnewVersion(newTestCaseID_B, 

Line 721 # summary='new version of TC B', importance='1')

print('copyTCnewVersion', response)

Test log: create new version of TC B Traceback (most recent call last): File "TestLinkExample.py", line 721, in summary='new version of TC B', importance='1') File "/root/.pyenv/versions/env/lib/python2.7/site-packages/testlink/testlinkapi.py", line 189, in copyTCnewVersion duplicateaction = 'create_new_version') File "/root/.pyenv/versions/env/lib/python2.7/site-packages/testlink/testlinkapi.py", line 258, in _copyTC origArgItems['testprojectid'] = self.getProjectIDByNode(origTestCaseId) File "/root/.pyenv/versions/env/lib/python2.7/site-packages/testlink/testlinkapi.py", line 166, in getProjectIDByNode node_path = self.getFullPath(int(a_nodeid))[a_nodeid] KeyError: 754

2) TestLinkExampleGernericApi.py -->Normal execution 3) TestLinkExampleGernericApi_Req.py -->Normal execution 4) TestLinkExample_CF_KW.py -->Normal execution

Do I have other areas that need to be modified to make the program work properly?

Regards Reynold

lczub commented 5 years ago

copyTCnewVersion is a helper method, which combines several api methods. TestLinkExampleGernericApi.py shows, that the api methods itself works, but some unexpected data situation occurs when calling getFullPath in copyTCnewVersion. For debugging it would be helpful, when you add an additional print statement _print( self.getFullPath(int(anodeid)) ) before calling _node_path = self.getFullPath(int(a_nodeid))[anodeid] Regards Luiko

reynold6215 commented 5 years ago

Dear Sir,

Thank you for your explanation. Sorry, I will return to you now. I will try the part you explained again.

Reynold