思路
1.首先选取数据存储的方式(本篇主要以excel为主),然后二次封装相应xlrd模块读取excel内容(excel_utils),使用testdata_utils调用excel_utils来读取成我们想要的数据格式
2.使用config配置并读取使用
3.封装相应requests模块方法,get/post方法,然后使用相关excel读取数据的方法,来对requests进行驱动
4.接下来封装异常及断言使用;
5.将用例整合至一起运行
6.生成报告和发送邮件功能
框架

实现
excel封装(common\excel_utils.py) 1.首先得自己搭建一个excel的文件,里面存放测试用例编号,测试用例名称,用例执行等,如下图  2.这里面用到了合并单元格,所以使用了merged_cells方法(具体相关使用可查看https://www.cnblogs.com/ClownAlin/p/13224919.html)
3.具体封装  数据读取(common\testdata_utils.py)  config读取使用 存放(conf/config.ini)  读取(common\local_config_utils.py) 
免费领取源码+海量学习资料+面试资料+学习测试视频加群号:646294456
|