|
from locust import HttpLocust,task,TaskSetclass userBehavior(TaskSet): #指定测试任务 @task def test_login(self): # 定义注册的测试数据 for i in range(10,21): user = "test" + str(i) registerData = {"email":user + "@qq.com", "username":user, "password":"123456", "repassword":"123456", "captcha":"11111"} # 发送注册页请求给服务器 post response = self.client.post("/index.php?controller=simple&action=reg_act",data = registerData) loc = response.find("恭喜") if loc >= 0 : print("测试成功") else: print("测试失败")class WebSiteUser(HttpLocust): host = "http://localhost:8083/iwebshop" task_set = userBehavior min_wait = 2000 max_wait = 5000
在学课程
Python测试开发全栈核心课程 互联网测试工程师必修课
http://www.atstudy.com/course/1287
|
|