随笔分类 -  接口测试

跟着mushishi老师学习,记录学习笔记
摘要:step1: 修复:python -m ensurepip step2: 安装:python -m pip install --upgrade pip 阅读全文
posted @ 2021-12-15 22:42 文刀六日 阅读(60) 评论(0) 推荐(0)
摘要:1.安装包,pip install deepdiff 2.导入包: from deepdiff import DeepDiff 3. dict1 = {"aaa":"AAA","bbb":"BBB"} dict2 = {"c":"AAA","bbb":"BBB"} print(DeepDiff(di 阅读全文
posted @ 2021-07-10 22:44 文刀六日 阅读(266) 评论(0) 推荐(0)
摘要:1.加载文件 2.获取sheetname对象 3.获取行数 4.获取行值 阅读全文
posted @ 2021-07-07 22:21 文刀六日 阅读(89) 评论(0) 推荐(0)
摘要:1. 知识点: a. openpyxl.load_work()加载打开文件 b.sheetnames 获取所有 sheetname c.得到第一个sheetname的对象 open_excel = openpyxl.load_workbook(base_path+'/API_liujj_001/Ca 阅读全文
posted @ 2021-07-07 21:38 文刀六日 阅读(39) 评论(0) 推荐(0)
摘要:1.读取文件,首先要知道文件得目录地址,那么获取项目路径 curpath = os.path.realpath(__file__) 获取到当前文件得地址 root_dir = os.path.dirname(os.path.dirname(curpath)) 获取到项目根目录地址 2.知道项目根目录 阅读全文
posted @ 2021-02-23 22:12 文刀六日 阅读(1353) 评论(0) 推荐(0)
摘要:1.文件目录明明已经存在,但是还是报“ModuleNotFoundError: No module named 'config'” 2.解决方法:是将目录地址加入到系统文件 在文件中加入这两句 base_path = os.getcwd() sys.path.append(base_path) 个人 阅读全文
posted @ 2021-02-23 22:00 文刀六日 阅读(3100) 评论(0) 推荐(0)
摘要:1.在pytest框架中fixture类似于脚手架的作用 2.使用:@pytest.maker.fixture 阅读全文
posted @ 2021-02-05 11:27 文刀六日 阅读(84) 评论(0) 推荐(0)
摘要:学习知识点: 1.jsonpath中语法 $根目录 $.取到第一层目录值 $..取到多层目录值 2.可以进行逻辑判断?() ,使用@表达式获取当前节点 3.学习博客: https://www.cnblogs.com/yoyoketang/p/14305895.html 阅读全文
posted @ 2021-01-28 11:16 文刀六日 阅读(355) 评论(0) 推荐(0)
摘要:1.json转dict取值 json转dict json.loads() 取值用的get() 2.正则取值 使用得re.findall()或者re.search() jsonpath取值: 安装:pip install jsonpath jsonpath.jsonpath() $根目录 ..相对路径 阅读全文
posted @ 2021-01-27 14:29 文刀六日 阅读(121) 评论(0) 推荐(0)
摘要:1.查看pip版本:pip show pip 2.升级pip:python -m pip install --upgrade pip 3.安装jsonpath:pip install jsonpath 阅读全文
posted @ 2021-01-27 09:21 文刀六日 阅读(682) 评论(0) 推荐(0)
摘要:1.安装yaml pip install pyyaml,安装成功后site-packages文件夹中有yaml文件夹 2.学习string模块中的Template字符串类型,学习资料:博客https://www.cnblogs.com/paisen/p/3592118.html 读取字符串中变量的值 阅读全文
posted @ 2021-01-21 17:40 文刀六日 阅读(173) 评论(0) 推荐(0)
摘要:1.安装flask pip install flask 2.使用flask, 在服务器上面看到response返回数据 from flask import Flask app = Flask(__name__) @app.route('/',method = 'get') login(): data 阅读全文
posted @ 2020-09-23 23:19 文刀六日 阅读(101) 评论(0) 推荐(0)
摘要:import hashlib 思路: 比如说我要给百度网的host加密 host = ‘’www.baidu.com md5 = hashlib.md5() md5.update(host.encode('utf-8')) md5.hexdigest() print(res) 打印的结果: dab1 阅读全文
posted @ 2020-09-22 23:25 文刀六日 阅读(149) 评论(0) 推荐(0)
摘要:header的使用: imoprt requests url = '' head = { 'host':'www.baidu.com', 'Content-type':'application/json' } requests.get(url,headers = head) 阅读全文
posted @ 2020-09-20 23:19 文刀六日 阅读(183) 评论(0) 推荐(0)
摘要:1.下载文件的url 2.url是get还是post import requests down_url = '' res = request.get('url') --此时执行会返回200,此时的res只是个对象 with open('badu.apk','wb')as f: f.write(res 阅读全文
posted @ 2020-09-20 23:01 文刀六日 阅读(218) 评论(0) 推荐(0)
摘要:1.fiddler无法抓某网站的接口时,提示当前网络断开,非认证 fiddler-option-https-Ations- Export Root Certificate to Desktop 2.打开浏览器- 设置 - 隐私设置及安全性 - 证书管理 - 导入桌面证书至受信任的 根证书颁发机构 因 阅读全文
posted @ 2020-09-19 23:42 文刀六日 阅读(169) 评论(0) 推荐(0)
摘要:思路: 1. 接口请求 requests.post(url,files=file) 2.url,上传文件的接口地址 3.files,上传文件的信息 url = 'https://www.baidu.com/user/postpic' files = { --fileFieID是接口的参数,type也 阅读全文
posted @ 2020-09-19 23:22 文刀六日 阅读(151) 评论(0) 推荐(0)
摘要:接口测试- json格式处理: import json import requests url='http://www.baidu.com' data ={ 'username':'test01', 'password';'test01' } rest = requests.post(url,dat 阅读全文
posted @ 2020-09-19 22:53 文刀六日 阅读(176) 评论(0) 推荐(0)
摘要:--导入requests import requests url= 'http://www.baidu.com' get_url = 'https://www.baidu.com?username='test01'&password='test'' data = { 'username':'test 阅读全文
posted @ 2020-09-19 17:47 文刀六日 阅读(148) 评论(0) 推荐(0)
摘要:1.接口测试环境搭建 a. python3版本+ Visual Studio Code工具 b.python环境变量,百度 c.安装request第三方库:pip install requests 阅读全文
posted @ 2020-09-16 22:46 文刀六日 阅读(132) 评论(0) 推荐(0)