HttpRunner自動化框架學習筆記

一.簡單介紹

HttpRunner 是一款面向 HTTP(S) 協議的通用測試框架,只需編寫維護一份?YAML/JSON?腳本,即可實現自動化測試、性能測試、線上監控、持續集成等多種測試需求。

支持python2和python3

二.框架特點

  • 繼承?Requests?的全部特性,輕松實現 HTTP(S) 的各種測試需求
  • 采用?YAML/JSON?的形式描述測試場景,保障測試用例描述的統一性和可維護性
  • 借助輔助函數(debugtalk.py),在測試腳本中輕松實現復雜的動態計算邏輯
  • 支持完善的測試用例分層機制,充分實現測試用例的復用
  • 測試前后支持完善的 hook 機制
  • 響應結果支持豐富的校驗機制
  • 基于 HAR 實現接口錄制和用例生成功能(har2case)
  • 結合?Locust?框架,無需額外的工作即可實現分布式性能測試
  • 執行方式采用 CLI 調用,可與 Jenkins 等持續集成工具完美結合
  • 測試結果統計報告簡潔清晰,附帶詳盡統計信息和日志記錄
  • 極強的可擴展性,輕松實現二次開發和 Web 平臺化

三.安裝使用

pip install httprunner

確認是否安裝成功

httprunner -V    (大寫)

出現版本號即可

四.具體用法(此處僅使用yaml文件的寫法,json寫法與yaml類似)

下面的測試用例中包含了大部分常用的字段

?

轉載于:https://www.cnblogs.com/panpan0301/p/10174231.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/278593.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/278593.shtml
英文地址,請注明出處:http://en.pswp.cn/news/278593.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

如何在Chrome中為Gmail啟用桌面通知

Last year Google rolled out desktop notifications for Google Calendar, now you can get Gmail and Gchat notifications on your desktop too. Read on as we walk you through configuring them both. 去年Google推出了Google日歷的桌面通知,現在您也可以在桌…

vue集成iconfont、fontawesome和圖標選擇器(含fontawesome、el-icon和加入的iconfont)

目錄(一)引入iconfont字體圖標庫將圖標加入購物車新建(添加至)項目下載后項目中引入(二)引入fontawesome(三)圖標選擇器效果圖結構使用源碼(一)引入iconfont字…

java之Synchronize

2019獨角獸企業重金招聘Python工程師標準>>> 實現原理:JVM 是通過進入、退出對象監視器( Monitor )來實現對方法、同步塊的同步的。 具體實現是在編譯之后在同步方法調用前加入一個 monitor.enter 指令,在退出方法和異常處插入 monitor.exit …

pop()方法

pop()方法 描述 列表 pop() 方法通過指定元素的索引值來移除列表中的某個元素(默認是最后一個元素),并且返回該元素的值,如果列表為空或者索引值超出范圍會報一個異常。 語法 pop() 方法語法: L.pop([index-1]) 參數 i…

vue引入postcss-plugin-px2rem,px轉rem

npm install --save-dev postcss-plugin-px2remvue.config.js module.exports {css: {loaderOptions: {postcss: {plugins: [require(postcss-plugin-px2rem)({rootValue: 16, //換算基數, 默認100 ,1 / fontsize(html) x 原來的1px轉為0.0625rem// …

HikariCP連接池配置

2019獨角獸企業重金招聘Python工程師標準>>> HikariCP號稱性能最好的Java數據庫連接池。雖沒做過親測但是公司項目一直在用,大概經歷過2萬左右用戶同時在線,鏈接池性能方面未出現問題。 官網:http://brettwooldridge.github.io/Hi…

Microsoft Desktop Player是IT Pro的寶貴工具

If you are an IT Professional, a new education tool introduced by Microsoft is the MS Desktop Player. Today we take a look at what it has to offer, from Webcasts, White Papers, Training Videos, and more. 如果您是IT專業人員,則Microsoft推出的新的培…

如何在Microsoft Excel中將文本轉換為日期值

Analysis of business data often requires working with date values in Excel to answer questions such as “how much money did we make today” or “how does this compare to the same day last week?” And that can be hard when Excel doesn’t recognize the valu…

git針對已有倉庫或已有文件的初始化操作

git全局配置用戶 git config --global user.name “xxx” git config --global user.email “xxx.cn” 情況1、存在git倉庫 git clone url.git //cd xx //touch README.md //git add README.md //git commit -m "add README" //git push -u origin master情況2、已…

策略模式-Golang實現

目的:根據不同策略來執行對象的相應操作 和工廠模式很像,不同點在于: 工廠模式是傳入參數后創建對象,根據傳入的參數寫邏輯來判斷應該創建什么類型的對象,模式的使用者調用對象統一的方法操作。 策略模式是模式的使用者…

看著手機會讓您暈眩嗎? 禁用動畫

Giulio_Fornasar/ShutterstockGiulio_Fornasar /快門Are your phone’s buttery-smooth animations causing motion sickness, eyestrain, or even slow app performance? Those animations are just for looks, and you can disable a lot of them on both iPhone and Androi…

電腦的組成

一、按電腦組成分 1.CPU(中央處理器),是一塊超大規模的集成電路,有很多針腳,是電腦的核心,它是電腦進行運算和控制的核心,處理著各種信息的運算,就像人計算數學題要用頭腦運算一樣。…

【云周刊】第139期:阿里年會黑科技全揭秘:IoT手環、人臉識別驗票、大屏彈幕互動等“十八般武藝”輪番上陣...

摘要:阿里年會黑科技全揭秘:IoT手環、人臉識別驗票、大屏彈幕互動等“十八般武藝”輪番上陣,2017上半年無監督特征學習研究成果匯總,CDN最全學習教程,量子計算會帶來什么樣的革命?更多精彩技術資訊&#xf…

微信小程序之 SideBar(側欄分類)

項目目錄: 模擬數據: utils / data.js function getSData() {var data [{"id": 1,"tree": {"id": 1,"desc": "寶寶奶粉","desc2": null,"level": "level1","log…

騰訊地圖判斷點是否在區域內

鏈接添加幾何計算庫&#xff1a;librariesgeometry xxx為自己的key <script charset"utf-8" src"https://map.qq.com/api/gljs?v1.exp&keyxxx&librariesgeometry"></script>調用 TMap.geometry.isPointInPolygon(position, paths)

如何在線查找成千上萬的免費電子書

You’ve got an ebook reader (or a laptop or netbook with ebook reading software) now you just need some free books to put it to good use. Read on as we show you the best places to score free books online. 您已經有了一個電子書閱讀器(或帶有電子書閱讀軟件的筆…

【SDOI2008】儀仗隊

題面 題解 當$(x,y)$能被看到時&#xff0c;$gcd(x,y)1$&#xff0c; 所以可以求$\sum_{i0}^n\sum_{j0}^n[gcd(x,y)1]$ 或者用歐拉函數 代碼 #include<bits/stdc.h> #define RG register #define clear(x, y) memset(x, y, sizeof(x)); using namespace std;template<…

kbone-cli初始化項目,提示‘模板xx不存在’

取消git代理就好了 git config --global --unset http.proxygit config --global --unset https.proxykbone init my-app跳轉目錄 cd my-app開發小程序 npm run mp開發 Web npm run web 發布 Web npm run build恭喜你! "my-app"項目初始化成功!

Spring Bean默認配置為單實例 Spring Bean生命周期

2019獨角獸企業重金招聘Python工程師標準>>> Spring 的Bean默認的是單例的. 如果不想單例需要如下配置&#xff1a; <bean id"user" class"..." scope"singleton"/> scope"singleton"就是配置這個bean是單例的&#…

minecraft服務器_如何啟動自己的Minecraft服務器進行多人游戲

minecraft服務器If you’ve played Minecraft, then it’s easy to see how much fun it can be. Running your own server lets you bring all of your friends into the same game, and you can play with rules you get to make or break. It’s the ultimate in an already…