Jenkins + Robot framework(Win10) 进行API接口自动化测试

一. Robot framework安装:

1. robot framework Github:https://github.com/robotframework/robotframework/blob/master/INSTALL.rst

安装:  如果你安装了 pip,只需运行  

pip install robotframework

2. 加 Path:runner scripts , the interpreter itself 

path=%path%;D:\workspace\Test\Test\InterfaceTest\testCases

3. Verifying installation:

$ robot --version

Robot Framework 3.0 (Python 2.7.10 on linux2)

$ rebot --version

Rebot 3.0 (Python 2.7.10 on linux2)

4.RIDE:  https://github.com/robotframework/RIDE

pip install -U https://github.com/robotframework/RIDE/archive/master.zip

Bat 启动 robot framework:

01.在桌面新增文本文档

02.输入python -c "from robotide import main; main()

03.保存后修改后缀为 bat 即可

安装 requests/requestsLibrary 插件

进入C:\Pyhon27\scripts

先要安装requests,再安装requestsLibrary

安装requests: 官方下载地址:https://pypi.python.org/pypi/requests

pip install requests

安装requestsLibrary:官方下载地址:https://pypi.python.org/pypi/robotframework-requests/

pip install robotframework-requests

二. Jenkins安装:

(略)

三. 安装Robot Framework插件

作用:解析RF运行后的output.xml文件,将解析的结果展示出来。

步骤:进入jenkins主页面,系统管理-管理插件-可选插件,在过滤窗口输入robot,安装Robot Framework插件

Email Extension Plugin、Zentimestamp pluginPowerShell plugin

四 Jenkins TFS 配置

Jenkins 插件里搜索了下,没搜到TFS插件。搜索了下 TFS插件被关闭。

issue: https://issues.jenkins.io/browse/INFRA-2751

https://www.jenkins.io/doc/pipeline/steps/tfs/#stepclass-teamcollectresultspostbuildaction-collect-results-for-tfsteam-services

未被关闭前安装截图:

可以通过 hpi 文件手动安装: 

下载地址  GitHub:https://github.com/jenkinsci/tfs-plugin/releases

Manage Jenkins==>Manage Plugins==>高级

 上传 hpi 插件。

五. 构建robot framework任务 

单击新建任务

选择 Free Style project:

选择Git:Repository browser里也有TFS:

选择Source Code - TFVC: (需安装hpi后出现)

Add Build trigger:

日程表中从左到右依次是:

分钟     小时     天       月      星期

0~59  0~23  1~31  1~12   0~7

H H(1-9) * * 1-5

 选择构建:

robot -dd:\RFLog  "D:\workspace\Test\Test\InterfaceTest\testCases\testCases.robot"

-d:指定3个log文件的输出位置为f盘RFLog文件夹

-t:指定测试用例的名称

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值