UPDATE

上级 df352508
print('欢迎来到 InsCode')
\ No newline at end of file
from locust import HttpUser, TaskSet, task
import urllib3
urllib3.disable_warnings()
class UserBehavior(TaskSet):
def on_start(self):
print("start****")
def on_stop(self):
print("stop****")
@task(1)
def baidu_page1(self):
res = self.client.get("/", verify=False)
class WebsiteUser(HttpUser):
tasks = [UserBehavior]
host = "https://www.baidu.com"
min_wait = 1000
max_wait = 2000
if __name__ == '__main__':
import os
os.system("locust -f main.py --host=https://www.baidu.com")
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册