2、Loust并发测试,将查询结果返回给另一接口

from time import sleep

from locust import *
import requests, os
from acount import name

from random import choice

url = 'http://xxx.xxx.xx.x:8080/sw/j_spring_security_check'


# 余额调整新增
class TestTaskset(TaskSet):
    s = requests.session()

    @task(1)
    def register(self):
        # 生成登录账号
        telData = name

        tel = choice(name)

        self.s.keep_alive = False
        data = {"j_username": tel,
                "j_password": "111111",
                "is_soft_dog": "1",
                "login_xtmc": "xxx",
                }
        r = self.s.post(url, data=data)

    def searchCount(self):
        searchCount = 'http://xxx.xxx.xx.x:8080/sw/a/method_findYeByDahAndZhlx_az02.action'

        countData = {
            'dah': '5110058074',
            'zhlx': 'A账户'}

        ress = self

你可能感兴趣的:(工作相关)