请选择 进入手机版 | 继续访问电脑版

湖南新梦想

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 653|回复: 0

JMETER模拟发帖过程

[复制链接]

21

主题

21

帖子

112

积分

注册会员

Rank: 2

积分
112
发表于 2022-9-4 10:25:25 | 显示全部楼层 |阅读模式
第一步:新建一个线程(线程(用户)->线程组)
第二步:添加一个事物控制器(逻辑控制器->事物控制器)
第三步:增加一个HTTP请求默认值
输入协议:http
服务器名称或IP:47.107.178.45
端口:80
内容编码:utf-8
第四步:增加打开首页HTTP请求
HTTP请求为:get
路径:/phpwind/
第五步:增加一个登录HTTP请求
协议:http
http请求:post
路径:/phpwind/index.php?m=u&c=login&a=dologin
参数为:
username小同志falsetext/plaintrue
password123456falsetext/plaintrue
csrf_token${t_value}falsetext/plaintrue
csrf_token${t_value}falsetext/plaintrue
在打开首页HTTP请求中增加一个正则表达式
引用名称为:t_value
正则表达式:<input type="hidden" name="csrf_token" value="(.+?)"/>
模板:$1$
匹配数字:0
增加HTTPcookie管理器
第六步:增加登录之后的跳转的HTTP请求
HTTP请求:get
路径:/phpwind/index.php
参数:
mufalsetext/plaintrue
cloginfalsetext/plaintrue
awelcomefalsetext/plaintrue
_statu${statu_value}falsetext/plaintrue
在登录HTTP请求中增加一个正则表达式
引用名称:statu_value
正则表达式:_statu=(.+?)"
模板:$1$
匹配数字:0
再增加一个HTTP信息头管理器
参数:
X-Requested-WithXMLHttpRequest
Acceptapplication/json, text/javascript, */*; q=0.01
User-Agent        Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0
第七步:增加进入板块HTTP请求
HTTP请求:get
路径:/phpwind/index.php
参数:
cthreadfalsetext/plaintrue
fid13falsetext/plaintrue
第八步:增加一个进入发帖页面1请求
http请求:get
路径:/phpwind/index.php
参数
cpostfalsetext/plaintrue
fid13falsetext/plaintrue
第九步:增加一个进入发帖页面2HTTP请求
HTTP请求:get
路径:/phpwind/index.php
参数
memotionfalsetext/plaintrue
typebbsfalsetext/plaintrue
csrf_token${t_value}falsetext/plaintrue
第十步:增加一个发帖1HTTP请求
HTTP请求:post
路径:/phpwind/index.php?c=post&a=doadd&_json=1&fid=13
参数
atc_title大家好,我是刘倩falsetext/plaintrue
atc_content大家好,我是老六!falsetext/plaintrue
pidfalsetext/plaintrue
tidfalsetext/plaintrue
specialdefaultfalsetext/plaintrue
reply_notice1falsetext/plaintrue
csrf_token${t_value}falsetext/plaintrue
增加一个HTTP信息头管理器
参数
Acceptapplication/json, text/javascript, */*; q=0.01
User-AgentMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36 Edg/104.0.1293.70
X-Requested-WithXMLHttpRequest
第十一步:增加一个发帖2HTTP请求
HTTP请求:get
路径:/phpwind/read.php
参数
tid${tid}falsetext/plaintrue
fid${fid}falsetext/plaintrue
在发帖1中增加两个正则表达式
引用名称:tid
正则表达式:tid=(.+?)&
模板:$1$
匹配数字:0
引用名称:fid
正则表达式:fid=(.+?)"
模板:$1$
匹配数字:0
第十二步:增加一个发帖3HTTP请求
HTTP请求:珀斯特
路径:/phpwind/index.php?m=u&a=showcredit
参数
csrf_token${t_value}falsetext/plaintrue
第十三步:增加一个退出HTTP请求
HTTP请求:get
路径:/phpwind/index.php
参数
mufalsetext/plaintrue
cloginfalsetext/plaintrue
alogoutfalsetext/plaintrue








回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|湖南新梦想 ( 湘ICP备18019834号-2 )

GMT+8, 2023-12-4 01:10 , Processed in 0.044298 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表