Testlink接口使用方法-python语言远程调用
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源代码链接:
'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语言远程调用的更多相关文章
- 使用Socket&反射&Java流操作进行方法的远程调用(模拟RPC远程调用)
写在前面 阅读本文首先得具备基本的Socket.反射.Java流操作的基本API使用知识:否则本文你可能看不懂... 服务端的端口监听 进行远程调用,那就必须得有客户端和服务端.服务端负责提供服务,客 ...
- python web自动化测试框架搭建(功能&接口)——接口公共方法
接口公共方法有:数据引擎.http引擎.Excel引擎 1.数据引擎:获取用例.结果检查.结果统计 # -*- coding:utf-8 -*- from XlsEngine import XlsEn ...
- [转载] 基于Dubbo的Hessian协议实现远程调用
转载自http://shiyanjun.cn/archives/349.html Dubbo基于Hessian实现了自己Hessian协议,可以直接通过配置的Dubbo内置的其他协议,在服务消费方进行 ...
- 架构设计:一种远程调用服务的设计构思(zookeeper的一种应用实践)
在深入学习zookeeper我想先给大家介绍一个和zookeeper相关的应用实例,我把这个实例命名为远程调用服务.通过对这种应用实例的描述,我们会对zookeeper应用场景会有深入的了解. 远程调 ...
- JSON-RPC轻量级远程调用协议介绍及使用
这个项目能够帮助开发人员利用Java编程语言轻松实现JSON-RPC远程调用.jsonrpc4j使用Jackson类库实现Java对象与JSON对象之间的相互转换.jsonrpc4j包含一个JSON- ...
- 【Java EE 学习 78 中】【数据采集系统第十天】【Spring远程调用】
一.远程调用概述 1.远程调用的定义 在一个程序中就像调用本地中的方法一样调用另外一个远程程序中的方法,但是整个过程对本地完全透明,这就是远程调用.spring已经能够非常成熟的完成该项功能了. 2. ...
- Hessian怎样实现远程调用
1.Spring中除了提供HTTP调用器方式的远程调用,还对第三方的远程调用实现提供了支持,其中提供了对Hessian的支持. Hessian是由Caocho公司发布的一个轻量级的二进制协议远程调用实 ...
- 《Spring技术内幕》学习笔记17——Spring HTTP调用器实现远程调用
1.Spring中,HTTPInvoker(HTTP调用器)是通过基于HTTP协议的分布式远程调用解决方案,和java RMI一样,HTTP调用器也需要使用java的对象序列化机制完成客户端和服务器端 ...
- JSON-RPC远程调用协议
1. JSON-RPC简介 2. 请求 3. 响应 4. 错误 4.1. 错误对象 4.2. 错误码 5. 批量调用 6. 示例 6.1. 列表形式参数 6.2. key-value形式参数 6.3. ...
随机推荐
- Simplify Path——LeetCode
Given an absolute path for a file (Unix-style), simplify it. For example,path = "/home/", ...
- 60秒找到最对的size?为服饰电商提供尺寸匹配解决方案的True Fit获1500万美元融资 | 36氪
60秒找到最对的size?为服饰电商提供尺寸匹配解决方案的True Fit获1500万美元融资 | 36氪 60秒找到最对的size?为服饰电商提供尺寸匹配解决方案的True Fit获1500万美元融 ...
- Xcode use Protocol buffer
http://stackoverflow.com/questions/10277576/google-protocol-buffers-on-ios http://stackoverflow.com/ ...
- 区别assign VS weak,__block VS __weak
在objective-c中,类中的全局变量经常使用如下的方式申明. @property(nonatomic(1),strong(2))UIImageView *imageView; 其中的1,2处是对 ...
- 使用Java Mail发送邮件
本笔记参考自:高爽|Coder,原文地址:http://blog.csdn.net/ghsau/article/details/17839983 JavaMail是SUN提供给开发人员在应用程序中实现 ...
- Hive 创建和生成Rcfile 和SequenceFile格式的表
rcfile格式表需要从原始的textfile 文件格式表导出数据并导入到新建好的rcfile格式表里 转: HIVE RCFile高效存储结构 创建rcfile 格式的表: CREATE TABLE ...
- Win8 移除右键菜单中的SkyDrive Pro选项
Step 1:进入注册表编辑器 Win + R键调出运行窗口,然后输入regedit,进入注册表编辑器. Step 2:删除下面的键值 HKEY_CLASSES_ROOT\AllFilesystemO ...
- 15、Cocos2dx 3.0游戏开发找小三之Sprite:每一个精灵都是上辈子折翼的天使
重开发人员的劳动成果,转载的时候请务必注明出处:http://blog.csdn.net/haomengzhu/article/details/30475395 Sprite Sprite 能够说是 ...
- TeleMCU视频会议之Android版本号WebRTC client支持
本文原创自 http://blog.csdn.net/voipmaker 转载注明出处. 最新版本号TeleMCU 添加了Android手机端WebRTC视频会议能力,Android手机安装Chro ...
- Linux基本配置和管理 2 ---- Linux多命令协作----管道及重定向
1 管道和重定向 1 在Linux中大多数命令都很简单,很少出现复杂的命令,每个命令只是实现一个简单的功能,我们可以通过组合不同的命令来实现复杂的功能 2 在Linux中几乎所有的命令返回的数据都是纯 ...