Giter Site home page Giter Site logo

httprunnermanager's Introduction

HttpRunner

Github Actions codecov Go Reference downloads pypi version pyversions TesterHome

HttpRunner 是一个开源的 API 测试工具,支持 HTTP(S)/HTTP2/WebSocket/RPC 等网络协议,涵盖接口测试、性能测试、数字体验监测等测试类型。简单易用,功能强大,具有丰富的插件化机制和高度的可扩展能力。

HttpRunner 用户调研问卷 持续收集中,我们将基于用户反馈动态调整产品特性和需求优先级。

flow chart

版本发布日志 | English

设计理念

相比于其它 API 测试工具,HttpRunner 最大的不同在于设计理念。

  • 约定大于配置:测试用例是标准结构化的,格式统一,方便协作和维护
  • 标准开放:基于开放的标准,支持与 HAR/Postman/Swagger/Curl/JMeter 等工具对接,轻松实现用例生成和转换
  • 一次投入多维复用:一套脚本可同时支持接口自动化测试、性能测试、数字体验监测等多种 API 测试需求
  • 融入最佳工程实践:不仅仅是一款测试工具,在功能中融入最佳工程实践,实现面向网络协议的一站式测试解决方案

核心特性

  • 网络协议:完整支持 HTTP(S)/HTTP2/WebSocket,可扩展支持 TCP/UDP/RPC 等更多协议
  • 多格式可选:测试用例支持 YAML/JSON/go test/pytest 格式,并且支持格式互相转换
  • 双执行引擎:同时支持 golang/python 两个执行引擎,兼具 go 的高性能和 pytest 的丰富生态
  • 录制 & 生成:可使用 HAR/Postman/Swagger/curl 等生成测试用例;基于链式调用的方法提示也可快速编写测试用例
  • 复杂场景:基于 variables/extract/validate/hooks 机制可以方便地创建任意复杂的测试场景
  • 插件化机制:内置丰富的函数库,同时可以基于主流编程语言(go/python/java)编写自定义函数轻松实现更多能力
  • 性能测试:无需额外工作即可实现压力测试;单机可轻松支撑 1w+ VUM,结合分布式负载能力可实现海量发压
  • 网络性能采集:在场景化接口测试的基础上,可额外采集网络链路性能指标(DNS 解析、TCP 连接、SSL 握手、网络传输等)
  • 一键部署:采用二进制命令行工具分发,无需环境依赖,一条命令即可在 macOS/Linux/Windows 快速完成安装部署

用户声音

基于 252 份调研问卷的统计结果,HttpRunner 用户的整体满意度评分 4.3/5,最喜欢的特性包括:

  • 简单易用:测试用例支持 YAML/JSON 标准化格式,可通过录制的方式快速生成用例,上手简单,使用方便
  • 功能强大:支持灵活的自定义函数和 hook 机制,参数变量、数据驱动、结果断言等机制一应俱全,轻松适应各种复杂场景
  • 设计理念:测试用例组织支持分层设计,格式统一,易于实现测试用例的维护和复用

更多内容详见 HttpRunner 首轮用户调研报告(2022.02)

一键部署

HttpRunner 二进制命令行工具已上传至阿里云 OSS,在系统终端中执行如下命令可完成安装部署。

$ bash -c "$(curl -ksSL https://httprunner.com/script/install.sh)"

安装成功后,你将获得一个 hrp 命令行工具,执行 hrp -h 即可查看到参数帮助说明。

$ hrp -h

██╗  ██╗████████╗████████╗██████╗ ██████╗ ██╗   ██╗███╗   ██╗███╗   ██╗███████╗██████╗
██║  ██║╚══██╔══╝╚══██╔══╝██╔══██╗██╔══██╗██║   ██║████╗  ██║████╗  ██║██╔════╝██╔══██╗
███████║   ██║      ██║   ██████╔╝██████╔╝██║   ██║██╔██╗ ██║██╔██╗ ██║█████╗  ██████╔╝
██╔══██║   ██║      ██║   ██╔═══╝ ██╔══██╗██║   ██║██║╚██╗██║██║╚██╗██║██╔══╝  ██╔══██╗
██║  ██║   ██║      ██║   ██║     ██║  ██║╚██████╔╝██║ ╚████║██║ ╚████║███████╗██║  ██║
╚═╝  ╚═╝   ╚═╝      ╚═╝   ╚═╝     ╚═╝  ╚═╝ ╚═════╝ ╚═╝  ╚═══╝╚═╝  ╚═══╝╚══════╝╚═╝  ╚═╝

HttpRunner is an open source API testing tool that supports HTTP(S)/HTTP2/WebSocket/RPC
network protocols, covering API testing, performance testing and digital experience
monitoring (DEM) test types. Enjoy! ✨ 🚀 ✨

License: Apache-2.0
Website: https://httprunner.com
Github: https://github.com/httprunner/httprunner
Copyright 2017 debugtalk

Usage:
  hrp [command]

Available Commands:
  adb          simple utils for android device management
  boom         run load test with boomer
  build        build plugin for testing
  completion   Generate the autocompletion script for the specified shell
  convert      convert multiple source format to HttpRunner JSON/YAML/gotest/pytest cases
  help         Help about any command
  ios          simple utils for ios device management
  pytest       run API test with pytest
  run          run API test with go engine
  startproject create a scaffold project
  wiki         visit https://httprunner.com

Flags:
  -h, --help               help for hrp
      --log-json           set log to json format
  -l, --log-level string   set log level (default "INFO")
      --venv string        specify python3 venv path
  -v, --version            version for hrp

Use "hrp [command] --help" for more information about a command.

用户案例

赞助商

霍格沃兹测试开发学社

霍格沃兹测试开发学社是中国软件测试开发高端教育品牌,产品由国内顶尖软件测试开发技术专家携手打造,为企业与个人提供专业的技能培训与咨询、测试工具与测试平台、测试外包与测试众包服务。领域涵盖 App/Web 自动化测试、接口自动化测试、性能测试、安全测试、持续交付/DevOps、测试左移、测试右移、精准测试、测试平台开发、测试管理等方向。-> 联系我们

Subscribe

关注 HttpRunner 的微信公众号,第一时间获得最新资讯。

HttpRunner

httprunnermanager's People

Contributors

yileye avatar yinquanwang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

httprunnermanager's Issues

用例单个执行,前端报错

群里有写过,这里再提下吧; 用例列表——》单个执行用例前端报错,无法执行
报错:
Uncaught TypeError: window.location.href is not a function
at HTMLButtonElement.onclick ((index):264)
多个浏览器都不行

点击·新增用例·报错

用例列表中,点击新增用户报错。

信息如下。

Request Method: GET
http://192.168.37.99:8000/api/add_case/
2.0.3
FieldError
Cannot resolve keyword 'pro_name' into field. Choices are: create_time, dev_user, id, moduleinfo, other_desc, project_name, publish_app, responsible_name, simple_desc, test_user, update_time
/usr/local/lib/python3.5/site-packages/django/db/models/sql/query.py in add_fields, line 1706
/usr/bin/python
3.5.0
['/home/hrun/HttpRunnerManager', '/usr/local/lib/python35.zip', '/usr/local/lib/python3.5', '/usr/local/lib/python3.5/plat-linux', '/usr/local/lib/python3.5/lib-dynload', '/usr/local/lib/python3.5/site-packages', '/usr/local/lib/python3.5/site-packages/setuptools-39.0.1-py3.5.egg', '/usr/local/lib/python3.5/site-packages/pip-10.0.1-py3.5.egg', '/home/hrun/HttpRunnerManager']
星期三, 25 四月 2018 19:59:27 +0800

执行python manage.py makemigrations ApiManager 这个时,报没有数据库httprunner,实际我已经创建好了

执行python manage.py makemigrations ApiManager 这个时,报没有数据库httprunner;实际我已经创建好了。

D:\github\HttpRunnerManager>python manage.py makemigrations ApiManager
Traceback (most recent call last):
File "D:\application\Python\Python36-32\lib\site-packages\django\db\backends\base\base.py", line 216, in ensure_connection
self.connect()
File "D:\application\Python\Python36-32\lib\site-packages\django\db\backends\base\base.py", line 194, in connect
self.connection = self.get_new_connection(conn_params)
File "D:\application\Python\Python36-32\lib\site-packages\django\db\backends\mysql\base.py", line 236, in get_new_connection
return Database.connect(**conn_params)
File "D:\application\Python\Python36-32\lib\site-packages\MySQLdb_init_.py", line 86, in Connect
return Connection(*args, **kwargs)
File "D:\application\Python\Python36-32\lib\site-packages\MySQLdb\connections.py", line 204, in init
super(Connection, self).init(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1049, "Unknown database 'httprunner'")

没有入口添加config中的path配置

根据代码,配置中需要有path字段
image

但页面上没有添加该字段的入口
image

导致框架找不到debugtalk.py的路径,无法加载用例中调用的函数,导致用例最终失败。

status_code校验填写的是200,实际保存到数据库中是'200',导致校验出错

test_get3:httprunnermanager自己保存的数据
{'test': {'request': {'url': 'http://httpbin.org/get', 'method': 'GET'}, 'name': 'test_get3->test_module3->test_proj3', 'validate': [{'check': 'status_code', 'comparator': 'equals', 'expected': '200'}]}}

test_get4:手动到数据中中修改了expected的值
{'test': {'request': {'url': 'http://httpbin.org/get', 'method': 'GET'}, 'name': 'test_get4->test_module3->test_proj3', 'validate': [{'check': 'status_code', 'comparator': 'equals', 'expected': 200}]}}

运行结果
default

mysqlclient

[root@localhost ~]# pip install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-1.3.12.tar.gz
Complete output from command python setup.py egg_info:
sh: mysql_config: command not found
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-SEwKwu/mysqlclient/setup.py", line 17, in
metadata, options = get_config()
File "setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 26, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-SEwKwu/mysqlclient/

用例case_name为纯数字时,执行用例会报错,并且修改用例会提示“用例或配置已在该模块中存在,请重新命名”;

web报错内容:
'int' object has no attribute 'split'

后台报错内容:
Traceback (most recent call last):
AttributeError: 'int' object has no attribute 'split'
ERROR Internal Server Error: /api/run_batch_test/
Traceback (most recent call last):
TypeError: run_batch_test() takes 1 positional argument but 2 were given

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
AttributeError: 'int' object has no attribute 'split'
[06/Mar/2018 21:53:26] "POST /api/run_batch_test/ HTTP/1.1" 500 134622

本地运行测试案例时报错

下载最新的master版本,然后根据安装手册,运行单个测试的时候会报如下错误:
Traceback (most recent call last): File "D:\workspace\apitest\HttpRunnerManager\HttpRunnerManager\activator.py", line 25, in process fun = getattr(view, fun) AttributeError: module 'ApiManager.views' has no attribute 'run_batch_test'

新增用例,用例编辑页面,可选用例为空

新增用例,用例编辑页面,可选用例为空,必须要在所属模块,先点一下“请选择”,再次点击某模块,可选用例才可以选到已有用例;还可以连续重复添加依赖用例
_ _20180520010359
_ _20180520010411
_ _20180520011325

无法导入测试用例

mac系统 后太任务 celery rabbitmq都运行了 可是批量导入没有反应 请问是怎么回事?

[功能]上传功能优化

1.加入session检测 。[完成]
2.上传之后状态回写到上一个页面,并刷新数据 [完成]
3.支持上传时新建项目和模块,没有的默认归属未分类

不支持python2.7

django 2.0版本已经不支持python2.7了,requirements.txt 中的django要求为2.0

麻烦请问下,json格式的,多个中括号组合的data,这个该怎么书写呢?

当data由多个中括号的json组成时,这种情况下该怎么添加呢?比如下面这种
{"publicationType": "3",
"newspaper_metadata": {
"newspaperNameCn": "接口测试申请报纸数据-HLL",
"newspaperType": "123",
"newspaperCn": "123",
"versionNumber": "132",
"releaseDate": "2015-12-01",
"releaseArea": "123",
"issues": "111",
"infoIntegrity": 1,
"isTop": 1,
"specifyPublisherType": "111",
"specifyPublisherId": "1",
"specifyPublisherName": "test",
"fascicle": "111",
"bookmaker": "111",
"publishCountry": "123",
"organizers": "123",
"langId": 11,
"competentOrg": "123",
"keywords": "123",
"domPubUnit": "123",
"domEmailedCode": "123",
"forPubUnit": "123",
"forEmailedCode": "123",
"priceType": "11.3,CNY",
"codeType": "1",
"colors": "1"}}

项目名中出现空格时,新增添加模块处失败

问题描述:

新增的项目名中如果项目名里有空格,哪么无法给这个项目中添加模块,问题在于新增模块时发的POST请求中,传参belong_project的值不对,比如项目名为:TEST APP,那么添加模块的POST请求,belong_project值为TEST,即没有空格后面的东西。

解决办法:
修改add_module.html页面第28行为下面,即使用双引号将pro_name包住即可解决该BUG。
{{ foo.pro_name }}

权限控制

你好,想问一下项目权限管理是不是还没有实现?
我用不同的用户新建了两个项目(人员都只有创建人自己),登录看到的内容都是一样的。
麻烦回答一下,谢谢了

说明文档笔误

此处应该是一处笔误。
image
应该是:
python manage.py migrations xxx
python manage.py migrate

无效的项目或模块信息没有显示出来

get_pager_info函数不应该先根据status,进行一次过滤,即:文件 pagination.py文件的88行代码:
obj = Model.objects.filter(status__exact=filter) 应该修改为
obj = Model.objects.filter(),否则模块和项目列表只会显示有效的。

创建case时无法读取项目下的模块列表

image

def add_case(request):
project = ProjectInfo.objects.all().values('pro_name').order_by('create_time')
print(project)
if request.is_ajax():
testcase_lists = json.loads(request.body.decode('utf-8'))
msg = case_info_logic(**testcase_lists)
return HttpResponse(get_ajax_msg(msg, '用例添加成功'))
elif request.method == 'GET':
return render_to_response('add_case.html', {'project': project})

定位到这段代码,应该是没有用外键去查询项目对应的模块信息

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.