前提:
pip install TestLink-API-Python-client
代码如下
from testlink import * url = 'http://172.16.xx.xx/testlink/lib/api/xmlrpc/v1/xmlrpc.php' #ip地址为安装的testlink ip key = '73e53369b9f4dc9a88a16e7620a5ce33' # API key tlc = TestlinkAPIClient(url, key) projects = tlc.getProjects() animbus = projects[0] #因为只有一个测试项目,故为0 topSuites = tlc.getFirstLevelTestSuitesForTestProject(animbus['id']) #len(topSuites) #6 suite = topSuites[0] for suite in topSuites: print suite['id'], suite['name'] |
输出结果:
20 OpenStack UI测试
14 OpenStack API测试
938 OpenStack 性能测试
1019 可用性测试
1122 性能测试
1183 故障测试