deepin@deepin-pc:~/test$ cat libclienttestlink.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*- #! /usr/bin/python
#
# Testlink API Sample Python 3.1.2 getProjects() - Client implementation
#
import xmlrpc.client class TestlinkAPIClient:
# substitute your server URL Here
SERVER_URL = "https://******************************/xmlrpc.php" def __init__(self):
self.server = xmlrpc.client.ServerProxy(self.SERVER_URL)
self.devKey = "your user key" def getInfo(self):
return self.server.tl.about() def getProjects(self):
return self.server.tl.getProjects(dict(devKey=self.devKey)) def getClientTL(self):
return self.server.tl client = TestlinkAPIClient()
tlclient = client.getClientTL() args = {}
args["devKey"] = client.devKey
args["testplanname"] = "pythontest"
args["testprojectname"] = "LSTest" client = TestlinkAPIClient()
tlclient = client.getClientTL() print(client.getInfo())
print("-" * 80)
print(tlclient.getTestPlanByName(args))

把代码中变量设置为本地环境后就可以实现远程调用Testlink了。

输出结果:

 deepin@deepin-pc:~/test$ python3 libclienttestlink.py
Testlink API Version: 1.0 initially written by Asiel Brumfield
with contributions by TestLink development Team
--------------------------------------------------------------------------------
[{'name': 'pythontest', 'is_public': '', 'testproject_id': '', 'notes': '', 'is_open': '', 'id': '', 'api_key': 'c48e5b0e375c13c847b4148fcf4e283615619e52b427c11ff023e4a7d9b78bd1', 'active': ''}]
deepin@deepin-pc:~/test$

未完待续

Testlink源代码链接:

https://github.com/TestLinkOpenSourceTRMS/testlink-code/blob/5bb8e574ecc4adca5664437ee3a80c9e8d7c434d/lib/api/xmlrpc/v1/xmlrpc.class.php

'tl.reportTCResult' => 'this:reportTCResult',
'tl.setTestCaseExecutionResult' => 'this:reportTCResult',
'tl.createBuild' => 'this:createBuild',
'tl.createPlatform' => 'this:createPlatform',
'tl.createTestCase' => 'this:createTestCase',
'tl.createTestCaseSteps' => 'this:createTestCaseSteps',
'tl.createTestPlan' => 'this:createTestPlan',
'tl.createTestProject' => 'this:createTestProject',
'tl.createTestSuite' => 'this:createTestSuite',
'tl.deleteTestCaseSteps' => 'this:deleteTestCaseSteps',
'tl.deleteTestPlan' => 'this:deleteTestPlan',
'tl.deleteTestProject' => 'this:deleteTestProject',
'tl.uploadExecutionAttachment' => 'this:uploadExecutionAttachment',
'tl.uploadRequirementSpecificationAttachment' => 'this:uploadRequirementSpecificationAttachment',
'tl.uploadRequirementAttachment' => 'this:uploadRequirementAttachment',
'tl.uploadTestProjectAttachment' => 'this:uploadTestProjectAttachment',
'tl.uploadTestSuiteAttachment' => 'this:uploadTestSuiteAttachment',
'tl.uploadTestCaseAttachment' => 'this:uploadTestCaseAttachment',
'tl.uploadAttachment' => 'this:uploadAttachment',
'tl.assignRequirements' => 'this:assignRequirements',
'tl.addTestCaseToTestPlan' => 'this:addTestCaseToTestPlan',
'tl.addPlatformToTestPlan' => 'this:addPlatformToTestPlan',
'tl.removePlatformFromTestPlan' => 'this:removePlatformFromTestPlan',
'tl.getExecCountersByBuild' => 'this:getExecCountersByBuild',
'tl.getIssueTrackerSystem' => 'this:getIssueTrackerSystem',
'tl.getProjects' => 'this:getProjects',
'tl.getProjectKeywords' => 'this:getProjectKeywords',
'tl.getProjectTestPlans' => 'this:getProjectTestPlans',
'tl.getTestCaseAssignedTester' => 'this:getTestCaseAssignedTester',
'tl.getTestCaseBugs' => 'this:getTestCaseBugs',
'tl.getTestCaseKeywords' => 'this:getTestCaseKeywords',
'tl.getTestProjectByName' => 'this:getTestProjectByName',
'tl.getTestPlanByName' => 'this:getTestPlanByName',
'tl.getTestPlanPlatforms' => 'this:getTestPlanPlatforms',
'tl.getTotalsForTestPlan' => 'this:getTotalsForTestPlan',
'tl.getBuildsForTestPlan' => 'this:getBuildsForTestPlan',
'tl.getLatestBuildForTestPlan' => 'this:getLatestBuildForTestPlan',
'tl.getLastExecutionResult' => 'this:getLastExecutionResult',
'tl.getTestSuitesForTestPlan' => 'this:getTestSuitesForTestPlan',
'tl.getTestSuitesForTestSuite' => 'this:getTestSuitesForTestSuite',
'tl.getTestCasesForTestSuite' => 'this:getTestCasesForTestSuite',
'tl.getTestCasesForTestPlan' => 'this:getTestCasesForTestPlan',
'tl.getTestCaseIDByName' => 'this:getTestCaseIDByName',
'tl.getTestCaseCustomFieldDesignValue' => 'this:getTestCaseCustomFieldDesignValue',
'tl.getTestCaseCustomFieldExecutionValue' => 'this:getTestCaseCustomFieldExecutionValue',
'tl.getTestCaseCustomFieldTestPlanDesignValue' => 'this:getTestCaseCustomFieldTestPlanDesignValue',
'tl.getTestSuiteCustomFieldDesignValue' => 'this:getTestSuiteCustomFieldDesignValue',
'tl.getTestPlanCustomFieldDesignValue' => 'this:getTestPlanCustomFieldDesignValue',
'tl.getReqSpecCustomFieldDesignValue' => 'this:getReqSpecCustomFieldDesignValue',
'tl.getRequirementCustomFieldDesignValue' => 'this:getRequirementCustomFieldDesignValue',
'tl.getFirstLevelTestSuitesForTestProject' => 'this:getFirstLevelTestSuitesForTestProject',
'tl.getTestCaseAttachments' => 'this:getTestCaseAttachments',
'tl.getTestCase' => 'this:getTestCase',
'tl.getFullPath' => 'this:getFullPath',
'tl.getTestSuiteByID' => 'this:getTestSuiteByID',
'tl.getUserByLogin' => 'this:getUserByLogin',
'tl.getUserByID' => 'this:getUserByID',
'tl.deleteExecution' => 'this:deleteExecution',
'tl.doesUserExist' => 'this:doesUserExist',
'tl.updateTestCaseCustomFieldDesignValue' => 'this:updateTestCaseCustomFieldDesignValue',
'tl.updateTestCase' => 'this:updateTestCase',
'tl.setTestCaseExecutionType' => 'this:setTestCaseExecutionType',
'tl.assignTestCaseExecutionTask' => 'this:assignTestCaseExecutionTask',
'tl.unassignTestCaseExecutionTask' => 'this:unassignTestCaseExecutionTask',
'tl.addTestCaseKeywords' => 'this:addTestCaseKeywords',
'tl.removeTestCaseKeywords' => 'this:removeTestCaseKeywords',
'tl.updateTestSuiteCustomFieldDesignValue' => 'this:updateTestSuiteCustomFieldDesignValue',
'tl.getTestSuite' => 'this:getTestSuite',
'tl.checkDevKey' => 'this:checkDevKey',
'tl.about' => 'this:about',
'tl.testLinkVersion' => 'this:testLinkVersion',
'tl.setTestMode' => 'this:setTestMode',
'tl.ping' => 'this:sayHello',
'tl.sayHello' => 'this:sayHello',
'tl.repeat' => 'this:repeat'

Testlink接口使用方法-python语言远程调用的更多相关文章

  1. 使用Socket&反射&Java流操作进行方法的远程调用(模拟RPC远程调用)

    写在前面 阅读本文首先得具备基本的Socket.反射.Java流操作的基本API使用知识:否则本文你可能看不懂... 服务端的端口监听 进行远程调用,那就必须得有客户端和服务端.服务端负责提供服务,客 ...

  2. python web自动化测试框架搭建(功能&接口)——接口公共方法

    接口公共方法有:数据引擎.http引擎.Excel引擎 1.数据引擎:获取用例.结果检查.结果统计 # -*- coding:utf-8 -*- from XlsEngine import XlsEn ...

  3. [转载] 基于Dubbo的Hessian协议实现远程调用

    转载自http://shiyanjun.cn/archives/349.html Dubbo基于Hessian实现了自己Hessian协议,可以直接通过配置的Dubbo内置的其他协议,在服务消费方进行 ...

  4. 架构设计:一种远程调用服务的设计构思(zookeeper的一种应用实践)

    在深入学习zookeeper我想先给大家介绍一个和zookeeper相关的应用实例,我把这个实例命名为远程调用服务.通过对这种应用实例的描述,我们会对zookeeper应用场景会有深入的了解. 远程调 ...

  5. JSON-RPC轻量级远程调用协议介绍及使用

    这个项目能够帮助开发人员利用Java编程语言轻松实现JSON-RPC远程调用.jsonrpc4j使用Jackson类库实现Java对象与JSON对象之间的相互转换.jsonrpc4j包含一个JSON- ...

  6. 【Java EE 学习 78 中】【数据采集系统第十天】【Spring远程调用】

    一.远程调用概述 1.远程调用的定义 在一个程序中就像调用本地中的方法一样调用另外一个远程程序中的方法,但是整个过程对本地完全透明,这就是远程调用.spring已经能够非常成熟的完成该项功能了. 2. ...

  7. Hessian怎样实现远程调用

    1.Spring中除了提供HTTP调用器方式的远程调用,还对第三方的远程调用实现提供了支持,其中提供了对Hessian的支持. Hessian是由Caocho公司发布的一个轻量级的二进制协议远程调用实 ...

  8. 《Spring技术内幕》学习笔记17——Spring HTTP调用器实现远程调用

    1.Spring中,HTTPInvoker(HTTP调用器)是通过基于HTTP协议的分布式远程调用解决方案,和java RMI一样,HTTP调用器也需要使用java的对象序列化机制完成客户端和服务器端 ...

  9. JSON-RPC远程调用协议

    1. JSON-RPC简介 2. 请求 3. 响应 4. 错误 4.1. 错误对象 4.2. 错误码 5. 批量调用 6. 示例 6.1. 列表形式参数 6.2. key-value形式参数 6.3. ...

随机推荐

  1. a为整型数组,&a+1的含义

    #include <stdio.h> int main() { int a[10]; printf("a的值为:\t%d\n",a); printf("&am ...

  2. 《ACM国际大学生程序设计竞赛题解Ⅰ》——模拟题

    这篇文章来介绍一些模拟题,即一类按照题目要求将现实的操作转换成程序语言. zoj1003: On every June 1st, the Children's Day, there will be a ...

  3. POJ 2029 Get Many Persimmon Trees(水题)

    题意:在w*h(最大100*100)的棋盘上,有的格子中放有一棵树,有的没有.问s*t的小矩形,最多能含有多少棵树. 解法:最直接的想法,设d[x1][y1][x2][y2]表示选择以(x1, y1) ...

  4. 专注于个人服装定做_服装设计_Fabric_Design_Tailor-迦勒定制网

    专注于个人服装定做_服装设计_Fabric_Design_Tailor-迦勒定制网 客服热线:400-720-7206 工作时间:AM 09:00-PM 10:00 周六/周日/节假日:设计师休息

  5. 平衡树(AVL)详解

    1. 为什么平衡树? 在二叉搜索树(BST,Binary Search Tree)中提到,BST树可能会退化成一个链表(整棵树中只有左子树,或者只有右子树),这将大大影响二叉树的性能. 前苏联科学家G ...

  6. 作业.把c语言输出的基础差不多都概括了!

    // (1)1英里=1.60931公里,从键盘上输入英里数输出公里数 #include "stdio.h" #define PI 3.1415926 #include " ...

  7. Event 元标签中的代码提示问题

    自定的事件可以利用Event元标签在支持该事件的类里面做绑定,绑定后FlashBuilder会有代码提示,以提示该类支持的事件类型 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 ...

  8. winform combobox控件绑定 分类: WinForm 2014-04-17 14:34 118人阅读 评论(0) 收藏

    想要达到的效果:把数据库中的一列数据绑定到combobox控件中. 数据库表:T_Task//任务表 列名:Task_Name//名称 主键:Task_ID combobox控件名称:cbName 解 ...

  9. [置顶] 数据持久层(DAO)常用功能–通用API的实现

    在Web开发中,一般都分3层. Controller/Action 控制层, Service/Business 服务层/业务逻辑层, Dao 数据访问层/数据持久层. 在学习和工作的实践过程中,我发现 ...

  10. Android导出jar包后的资源使用问题

    我们常常遇到一个需求,就是给别人使用我们project的时候,为了可以屏蔽代码,把代码封装成jar包提供给第三方使用,可是这样我们的资源文件怎么给对方用呢? 网上有非常多方法,实用ClassLoade ...