#!/usr/bin/python # -*- coding: utf-8 -*- import testlink import pprint manual = 1 # 手动 automation = 2 # 自动 import ssl ssl._create_default_https_context = ssl._create_unverified_context # 连接test link url = "https://testlink.thiztech.com/testlink/lib/api/xmlrpc/v1/xmlrpc.php" key = "34c3194c732457cca2f5b0bfad8b72fe" # key tlc = testlink.TestlinkAPIClient(url, key) def get_information_test_project(): print("Number of Projects in TestLink: %s " % tlc.countProjects()) print("Number of Platforms (in TestPlans): %s " % tlc.countPlatforms()) print("Number of Builds : %s " % tlc.countBuilds()) print("Number of TestPlans : %s " % tlc.countTestPlans()) print("Number of TestSuites : %s " % tlc.countTestSuites()) #print("Number of TestCases (in TestSuites): %s " % tlc.countTestCasesTS()) print("Number of TestCases (in TestPlans) : %s " % tlc.countTestCasesTP()) tlc.listProjects() # tlc.getTestPlanByName('JFT','testplan1') //调试用环境 tlc.getTestPlanByName('tspauto','testplan1') get_information_test_project()