03 2023 档案
摘要:命令参数方式运行 # -*- coding: utf-8 -*- from locust import TaskSet, task, User ''' 命令行参数运行示例代码 ''' class Task_1(TaskSet): @task def task_a(self): print('打开冰箱
阅读全文
摘要:前言: 任务:简单的理解就是,你想要你脚本的虚拟用户去做哪些事,比如请求某一个接口,或者执行某一个事件 用户:可以理解为,执这个任务的实例主体,或者在locust 中,也可以认为是一群蝗虫 一、TaskSet 类 TaskSet是定义用户将执行的一组任务的类,然后通过虚拟用户调用并执行这一组任务 1
阅读全文
摘要:
1、使用方式 pip install 包名 -i 国内源地址 2、国内源地址 豆瓣(douban) http://pypi.douban.com/simple/ 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/ 中国科技大学 https://pypi.mi
阅读全文

摘要:
一、定位方式 二、实际应用 1、项目结构 2、locator_base.py 文件 # -*- coding: utf-8 -*- from selenium.webdriver.common.by import By # 元素定位方式 def locator(driver, find, type,
阅读全文

摘要:一、简介 tomorrow属于第三方的一个模块,使用threads方法作为装饰器去修饰一个普通的函数,使其可以达到并发效果。使用起来非常简单。 二、安装 pip install tomorrow 使用Pycharm安装 三、使用 1、项目结构 2、test_a.py # -*- coding:UTF
阅读全文