?、配置python環(huán)境
2、cmd中執(zhí)行以下命令 #提供讀寫Excel的能力
pip install xlrd
pip install xlwt
pip install pandas # 報錯的話,輸入pip --default-time=100 install pandas 就會成功安裝panda
3、pytest +allure環(huán)境安裝
pip install pytest #PyTest是基于python的開源測試框架,自動檢測測試用例,支持參數(shù)化,跳過特定用例,失敗重試等功能
pytest --version #查看版本
4、pytest規(guī)則
● 測試文件名要以 test_ 開頭或以 test 結尾
● 測試類要以 Test 開頭并且不能有 init 方法
● 測試函數(shù)要以 test 開頭,測試函數(shù)不必須在測試類當中
下載 allure,windows 和 mac 一樣
- allure包下載:https://github.com/allureframework/allure2/releases
- 下載最新版 zip 壓縮包,解壓縮到某個目錄,如 allure-commandline
- 把 bin 目錄加?環(huán)境變量
Windows 添加環(huán)境變https://www.icode9.com/content-3-740792.html
然后執(zhí) pip install allure-pytest 安裝 python 庫
-----post 和 get 請求的區(qū)別
get 請求默認會被瀏覽器緩存,但是post請求不會
get 請求只能進行url編碼,post請求支持多種編碼方式
get請求會被瀏覽器歷史記錄緩存,而post不會
get請求的參數(shù)直接暴露在url,post請求的參數(shù)在 body當中