lucust怎么模拟用户登录操作?
网友回复
安装好lucust后,将下面脚本保存为test.py
# This locust test script example will simulate a user # browsing the Locust documentation on https://docs.locust.io import random from locust import HttpUser, between, task from pyquery import PyQuery class AwesomeUser(HttpUser): host = "https://docs.locust.io/en/latest/" # we assume someone who is browsing the Locust docs, # generally has a quite long waiting time (between # 10 and 600 seconds), since there's a bunch of text # on each page wait_time = between(10, 600) ...
点击查看剩余70%