分享过<<接口自动化脚本设计思路总结>>
https://www.jianshu.com/p/f44bc84a9485
核心思想
截取每个接口URl地址,接口响应时间,换行写入txt,再从txt中把URL和响应时间分成2列写入Excel文件中。发送测试报告时把Excel文件作为附件一起发送。
解决思路:
- write_reponseTime_txt.py: 封装写个读取txt脚本;
- write_reponseTime_xls.py: 封装写个读取txt并写入excel脚本;
- Run_Mail_Report.py: 增加发送Excel文件附件的脚本;
代码截图
write_reponseTime_txt.py

write_reponseTime_xls.py

Testcase中: 获取URL和响应时间

邮件发送API_relult.xlsx文件

测试报告

网友评论