python自动化测试学习笔记-9测试框架
学习了这么久的python,我们已经可以自己搭建一个简单的测试和框架了,先从简单的开始,有时我们编写接口的测试用例会用excel进行编写,以下面的接口测试用例模板为例,进行编写;
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA60AAABlCAIAAAAplJLMAAAgAElEQVR4nO1d3aotRZJer+Jr1LX0PMhASV/3fV8Ozl1dzjzBCKdBWqREBBGcg4MIIux9RKvpRqWlUcRHqLmoqsyIyMifqpWRP3vFh8g+tWplfRkZGfllZK6s26pQKBQKhUKhUDwebrUJKBQKhUKhUCgUFaA6WKFQKBQKhULxiFAdrFAoFAqFQqF4RKgOVigUCoVCoVA8IlQHKxQKhUKhUCgeEaqDFQqFQqFQKBSPiF0H//7773V53AnlXxfKvy565//NN9/8oHh4fPPNN7U98S703g17598p+jV7v8whfv/9910H//bbb3Wp3AnlXxfKvy565//111/X1mCK+vj6669re+Jd6L0b9s6/U/Rr9n6ZQ/z222+7Dv7111/rUrkTyr8ulH9d9M7/q6++qq3BFPXx1Vdf1fbEu9B7N+ydf6fo1+z9Mof49ddfdx38yy+/CD7n9btvv/3Oez8KPkGE/4/vvfM2gVQtBO0Pa/Hua6GHlLG/nA+V8h+pNpDyH64KEhX48ssva2uwevj6v/7tT394y/z3H//1v7UZ1cKXX36Z37d+fO8d4rPulUyQHUbFaBvI8peGvH2EkN/svM/nt46wbinUmr/88suug//1r3+JPeXH9955+9133xWtlAh/tyVevyukY6TsjwjLdIV1XQvZX3A6Vch/xCDlP6Wq8MUXX9TWYJXw6Z/f+tMf/u0v/7f/c9PEjyqFv/jii/y+VVAHSw6jJTqjLH9pdKuD85udmOLH996RGTkFHabs6Lnr4J9//lnqIVt9hGslwp/h/PpdGX+Ssb8j28X6QyH7i81DSvmPFKT6b6kqvH79urYGq4K//vGBVa+L168FfK2gDhYcRtcSnVGWvzS61cH5zY5MISVa1gK6Uap0hJ9//nnXwf/85z+FnmGqI9gaQvxZHSbTNCL8xVSji0L2F3OiUvylINV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tQ/nWh/Ouid/6KLOjdDZS/4gL6NXu/zCGenp7+H3n/5aRxPN9BAAAAAElFTkSuQmCC" alt="" />
我们先来理一下思路:
1、我们需要获取文件,也就要知道文件的路径;
2、读取文件,取出要请求的URL,请求参数数据
3、用get或post方法调用接口
4、返回的数据与预期结果进行比较,判断用例结果
5、将请求报文、返回报文、测试结果、测试人员回写到excel中
6、生成测试报告
7、发送邮件
由此,我们来定义出框架的基本目录:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKIAAACpCAIAAAAnV3GPAAAIp0lEQVR4nO2dP2/bRhiH9Tn8JTymGjolzWzARscgSwlk8lKoW4YORgdCUwEDBYxMGeLBCRxZbgqodlwkrfOnRiomiiUHzmBEcVzXcWNk7HWgRB55PPJ4IqXTvb8HHMjTHUPoyR2PvlcvKwwQoDLpCwDjoBTNaw+2+e1Fp1fGvwLUGYfmtQfbz9od5dbderVScZrBcdOpxHGag2p8AZAzJs2yLaFxt16tVqsJ4ppOpLBbr1br3eFuZbgPkpBqbjQaruvGCl3XbTQamScdRbNvL6aUMZammbGmA89pSDW7rus4Dm9aLJHBi2w9ftZ6/ExZ81Begjdo1idt0Oa9qjtmnObOwaFf0jk4VNIc6hLFYdDWJ+Pe7NtdXFxUd8w4zSenZ37JyemZimbereBZ1BzMwOA4g+wpWK5+7KPbm8U5Ne81bdAG6SjNtFWmXTya9+amI3iNPVhBsyYGPVDFLcdLoFkfgzSD8sDftElgkuZ+n12/zj590t8HEkzSPDfHtrbYwgLr9TT3gQSTNPf7jDHW6bArVzT3gQSTNIPSgGYSQDMJoJkE0EwCaCaBcZp1wwW79aTAIixF+5iuWTlcEJrTmALNasseEs2AMQbNRDBac55wQV9zGH8yUB7abzqVar3u0IwqMldzzgAjPzRs2J+DgISI5uHn9G7Y5mrOGS4YG7SHh7He3A0+heaJMkpvhmYZ5mrWuDcHnsMDaGaMGa4590zbic/AoNnHGs0gDeM0gzKAZhJAMwmgmQTQTAJoJgE0kwCaSQDNJI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AAABJRU5ErkJggg==" alt="" />
conf 文件夹用来存放配置文件;
common用来存放工具和方法
cases 用来存放测试用例
bin目录用来存放执行文件
log目录存放日志文件
report目录存放测试报告
我们先在配置文件中定义一些通用的信息,定义一个setting.py
import os
#当前文件的父目录
BASE_PATH=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
#测试用例的路径
CASE_PATH=os.path.join(BASE_PATH,'cases')
#生成测试报告的路径
REPORT_PATH=os.path.join(BASE_PATH,'report')
#生成日志的路径
LOG_PATH=os.path.join(BASE_PATH,'log','ATP.log')
#邮件的配置信息
USER_EMAIL='邮箱地址'
EMAIL_HOST='smtp.qq.com'#邮箱服务器
EMAIL_PASSWD='授权码'#QQ邮箱是授权码
RECV_EMAIL='接收邮件的地址'
#测试人员信息
TESTER='PYF'
common文件夹下写公用的方法信息等;
读取case信息,需要用到xlrd模块,调用接口需要用到requests模块,根据测试用例的格式,分理处data数据,将结果反写到excel中需要用到xlwt模块;
在编写的过程中可以一个方法一个方法的写,写完后自己测试一下是否能正常实现;
import xlrd
import xlwt
import os
import requests
from common.Mylog import log
from xlutils.copy import copy class Mycase(object):
#获取测试用例文件中的测试用例
def getcase(self,case_path):
if os.path.isdir(case_path):
all_cases = []
for f in os.listdir(case_path):
book=xlrd.open_workbook(os.path.join(case_path,f))
sheet=book.sheet_by_index(0)
rows=sheet.nrows
for row in range(1,rows):
all_cases.append(sheet.row_values(row)[:8])
print(all_cases)
return all_cases
else:
raise Exception('测试用例不存在')
@classmethod
#get方法请求
def get(self,url,data=None):
datas=self.strToDict(data)
try:
res=requests.get(url,data=datas).json()
except Exception as e:
log.error('调用接口出错url:%s,请求报文:%s'%(url,datas))
return res,datas @classmethod
#post方法请求
def post(self,url,data,reffer=None):
datas=self.strToDict(data)
try:
res=requests.post(url,data=datas).json()
except Exception as e:
log.error('调用接口出错url:%s,请求报文:%s'%(url,datas))
return res,datas
#将字符串转化成字典类型
@classmethod
def strToDict(self,data):
data_dict={}
for i in data.split('&'):
key=i.split('=')[0]
value=i.split('=')[1]
data_dict[key]=value
return data_dict def checkRes(res,check_res):
res=res.replace("':'",'=').replace("':",'=')
for i in check_res.split(','):
if i not in res:
test_status='失败'
else:
test_status='通过'
return test_status #all_res=[data,res,test_status,tester]
#将结果写入excel中
def write_excel(case_path,all_res):
book=xlrd.open_workbook(case_path)
book2=copy(book)
sheet=book2.get_sheet(0)
row=1
for res in all_res:
sheet.write(row,8,res[0])
sheet.write(row,9,res[1])
sheet.write(row,10,res[2])
sheet.write(row,11,res[3])
row+=1
book2.save(case_path)
在run.py文件中编写执行测试用例的代码,整合各个方法:
import os,sys
import time
from conf.setting import TESTER
#添加环境变量
BASE_PATH=os.path.dirname(
os.path.dirname(
os.path.abspath(__file__)
)
)
sys.path.insert(0,BASE_PATH)
from common.GetCase import Mycase
from conf.setting import CASE_PATH
import common.GetCase class RunCase(object):
#找到测试用例
def find_case(self):
mycase=Mycase()
self.all_cases,self.case_file = mycase.getcase(CASE_PATH)
self.run_case(self.all_cases)
#运行测试用例
def run_case(self,all_cases):
excel_res=[]
for case in all_cases:
self.object=case[0]
self.mode=case[1]
self.case_id=case[2]
self.description=case[3]
self.url=case[4]
self.case_method=case[5]
self.data=case[6]
self.check_res=case[7]
if self.case_method.upper=='GET':
res,data=Mycase.get(url=self.url,data=self.data)
else:
res,data=Mycase.post(url=self.url,data=self.data)
test_status=common.GetCase.checkRes(res,check_res=self.check_res)
#根据写入excel的list格式,传入需要的参数
excel_res.append([data, res,test_status,TESTER])
print(excel_res)
common.GetCase.write_excel(self.case_file,excel_res)
运行查看结果:
mycase=RunCase()
mycase.find_case()
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZoAAABXCAIAAACyZRTqAAARQklEQVR4nO1dy2odPRI+r/K/Rq9NHqXNrPMOQ5a9nEcwnIUZY9oYgwlkjCFrh5B0SEhCQshL9Cy6W6oqlS590aXPqY/wc9wXdalU+lQqqfQf+r7v+/79+/ffC8J///X61T///s//cssB8f79+16wHj+u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wjNbqk+thV8uxESs7nekJBDgD27uyyQ2e/G89PwEnQc5y1GmreFc2PdxIKlsQnfUzNNxj1bpClhhgwqgfNYsCF+X4Rg4BNuxZ2XQe36gfZborKQ6V0tYHfaZ0akPOT2cCAlHRnrCzA88gGCrGSwHOUftwGIJm1N1AL+lJSBqkTnKSvkpAzgjqRUW7ws7YjJ+BakgKuoKkoC+BSWfTJGHPlAbmdVssRAo2A2gZpjmEzhTk+MbZ/3qDzqKfSicQCAIgh2tvQGdbjS0CwQK8iHc2Ieh/fSIgEDoTlIO9d1WhsyIgKhKUgL3bodBZERAVCUrA3u1Q6KwIiIoEJWDvdhiVzv4PEyACEqQx6goAAAAASUVORK5CYII=" alt="" />
可以看到excel中已经写入了相应的信息,接下来就是完善测试报告,发送邮件信息
python自动化测试学习笔记-9测试框架的更多相关文章
- python自动化测试学习笔记-5常用模块
上一次学习了os模块,sys模块,json模块,random模块,string模块,time模块,hashlib模块,今天继续学习以下的常用模块: 1.datetime模块 2.pymysql模块(3 ...
- python自动化测试学习笔记-8单元测试unittest模块
官方参考文档:http://docs.python.org/2.7/library/unittest.html unittest是一个python版本的junit,junit是java中的单元测试框架 ...
- python自动化测试学习笔记-1
一.什么是自动化 自动化测试是把以人为驱动的测试行为转化为机器执行的一种过程.直白的就是为了节省人力.时间或硬件资源,提高测试效率,便引入了通过软件或程序自动化执行测试用例进行测试: 二.python ...
- python自动化测试学习笔记-10YAML
之前学习的编写测试用例的方法,都是从excel中编写接口的测试用例,然后通过读取excel文件进行接口自动化测试,这种方式我们叫做数据驱动的方式,由于excel操作起来不灵活,无法实现关联关系的接口测 ...
- python自动化测试学习笔记-7面向对象编程,类,继承,实例变量,邮件
面向对象编程(OOP)术语: class TestClass(object): val1 = 100 def __init__(self): self.val2 = 200 ...
- python自动化测试学习笔记-6urllib模块&request模块
python3的urllib 模块提供了获取页面的功能. urllib.request.urlopen(url, data=None, [timeout, ]*, cafile=None, capat ...
- python自动化测试学习笔记-4常用模块
常用模块 1.os 2.sys 3.random 4.string 5.time 6.hashlib 一.os模块 os模块主要用来操作文件.目录,与操作系统无关.要使用os模块首先要导入OS模块,用 ...
- python自动化测试学习笔记-4内置函数,处理json
函数.全局变量 写代码时注意的几点事项: 1.一般写代码的时候尽量少用或不用全局变量,首先全局变量不安全,大家协作的情况下,代码公用容易被篡改,其次全局变量会一直占用系统内容. 2.函数里如果有多个r ...
- python自动化测试学习笔记-2-列表
上次我们学习了python的基本概念,了解了python的变量及数据类型,并实战了条件判断,for/while循环,字符串输出,格式化输出的一些基本用法,接下来我们继续学习其他的一些数据类型. pyt ...
随机推荐
- 【spring boot 系列】spring data jpa 全面解析(实践 + 源码分析)
前言 本文将从示例.原理.应用3个方面介绍spring data jpa. 以下分析基于spring boot 2.0 + spring 5.0.4版本源码 概述 JPA是什么? JPA (Java ...
- SOJ 4454 (矩阵快速幂)
先引入数的快速幂 例如计算2的5次方,常规算法2*2*2*2*2,利用快速幂的思想,求出5的二进制表达式101,权值为1和4的位上数字为1,即2^5=2^1*2^4.代码如下,时间复杂度为O(logn ...
- spring-kafka
spring-kafka 使用spring-kafka的小伙伴,看过来. 说明 因为spring-kafka封装的比较厉害,可能跟你实际使用起来有很大的差别. 一个简单的消费例子 在spring-bo ...
- Linux系统备份还原工具1(DD)(应用实例)
DD使用教程:http://www.cnblogs.com/EasonJim/p/7442223.html 以下实例没经过大量测试,可能在一些机器上不会有效. 一般围绕以下几点进行设置: 1.dd完后 ...
- Nginx教程收集
学习要系统,最推荐的方式是看书. 下面是收集的一些Nginx教程: https://www.gitbook.com/book/yinsigan/nginx/details http://www.ngi ...
- C# VS如何整个项目中查找字符串
Ctrl+F打开查找对话框,然后输入查找字符串,电机右边的小三角,选择整个解决方案,就可以遍历所有文件查找指定字符了
- Linux下完美使用find+grep实现全局代码搜索
作者:zhanhailiang 日期:2014-10-11 背景 在Window下有大量方便的图形化工具能够实现全局搜索,可是Linuxserver中因为使用命令行操作导致全局搜索是一个比較高的门槛. ...
- 小贝_mysql 存储过程
存储过程 简要: 1.什么是存储过程 2.使用存储过程 一.存储过程 概念类似于函数,就是把一段代码封装起来.当要行这段代码的时候,能够通过调用该存储过程来实现.在封装的语句体里面.能够用if/els ...
- iOS开发中訪问相冊摄像像头
iOS开发中訪问相冊摄像像头 源代码下载地址http://download.csdn.net/download/jingjingxujiayou/7270479 在AppDelegate.m文件里 - ...
- 用jquery给元素动态绑定事件及样式
网页输出的时候,可以用jquery给各种元素绑定事件,或设置样式. 之所以这样做,好处是节省代码,尤其适合元素很多,并且元素的事件对应的函数雷同的情况. 看看以下代码: <div id=&quo ...