HttpRunner3:003 - locust执行性能测试
2021-09-24 本文已影响0人
玩转测试开发
安装locust插件:
pip install locust==1.0.3
image.png
安装locusts:
pip install locusts
image.png
执行性能测试:locusts -f 和 locust -f的区别是前者可以运行.yaml或.json文件,并且转换为python文件,再按照locust的方式。
locusts -f myApiPro/testcases/demo_testcase_ref_test.py
image.png
image.png
至此,HttpRunner,locust执行性能测试,后续通过性能报告分析即可。
**详见locust教程:**
[locust2.0+教程:001 - 安装和目录结构](http://mp.weixin.qq.com/s?__biz=Mzg5NzEwMzkxNw==&mid=2247484559&idx=2&sn=82c17e3ccfa1fd82f7c4781d3d92e346&chksm=c077a5cdf7002cdb049e126dcfc249f87ea2fb14f1d3c31f9c3a1876b3b5055074fb4912eab3&scene=21#wechat_redirect)
[locust2.0+教程:002 - 快速使用](http://mp.weixin.qq.com/s?__biz=Mzg5NzEwMzkxNw==&mid=2247484559&idx=1&sn=b804ebd4f656577506dc8d9c36d8af42&chksm=c077a5cdf7002cdb16d48963248dfa8cb4584c8f77cec307a87667b93975a928f2d5dff684e7&scene=21#wechat_redirect)
[locust2.0+教程:003 - headless无界面模式](http://mp.weixin.qq.com/s?__biz=Mzg5NzEwMzkxNw==&mid=2247484566&idx=1&sn=bcb0822c3b3bd21aa50bb8d61956fc75&chksm=c077a5d4f7002cc21ae3926aca4d8696d4b829baf6ea70a86510aec7f0bfda5906691c43f8c0&scene=21#wechat_redirect)
[locust2.0+教程:004 - 等待时间和执行权重](http://mp.weixin.qq.com/s?__biz=Mzg5NzEwMzkxNw==&mid=2247484584&idx=1&sn=8bd3869b42d9a4f99eb03c13f062baac&chksm=c077a5eaf7002cfcd01f83d9ed7c58631436f280bfa659e96d93c0e1f17105bdae50e468868b&scene=21#wechat_redirect)
[locust2.0+教程:005 - on_start和on_stop](http://mp.weixin.qq.com/s?__biz=Mzg5NzEwMzkxNw==&mid=2247484584&idx=2&sn=695b96cdd857537d82f53dddde2dc41b&chksm=c077a5eaf7002cfc207848589850d77ed2df60d5e00696b3a31f3b922762835ca80da6e7b9fa&scene=21#wechat_redirect)
[locust2.0+教程:006 - @tag标签装饰器](http://mp.weixin.qq.com/s?__biz=Mzg5NzEwMzkxNw==&mid=2247484598&idx=1&sn=5a5fa2060737c80aff423b6a40f2ab01&chksm=c077a5f4f7002ce29b1a3d26093113b771e1f39b6ef09da2a929b898514ac1867f3ef89962b9&scene=21#wechat_redirect)
微信公众号:玩转测试开发
欢迎关注,共同进步,谢谢!